Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use secretTextarea for SSH key UI #40

Merged
merged 4 commits into from
Apr 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd">
<extension>
<groupId>io.jenkins.tools.incrementals</groupId>
<artifactId>git-changelist-maven-extension</artifactId>
<version>1.0-beta-7</version>
</extension>
</extensions>
2 changes: 2 additions & 0 deletions .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-Pconsume-incrementals
-Pmight-produce-incrementals
12 changes: 10 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</parent>

<artifactId>ssh-credentials</artifactId>
<version>1.16-SNAPSHOT</version>
<version>${revision}${changelist}</version>
<packaging>hpi</packaging>

<name>SSH Credentials Plugin</name>
Expand Down Expand Up @@ -66,10 +66,12 @@
<connection>scm:git:git://github.com/jenkinsci/ssh-credentials-plugin.git</connection>
<developerConnection>scm:git:[email protected]:jenkinsci/ssh-credentials-plugin.git</developerConnection>
<url>http://github.com/jenkinsci/ssh-credentials-plugin</url>
<tag>HEAD</tag>
<tag>${scmTag}</tag>
</scm>

<properties>
<revision>1.16</revision>
<changelist>-SNAPSHOT</changelist>
<jenkins.version>2.73.3</jenkins.version>
<java.level>8</java.level>
</properties>
Expand All @@ -95,6 +97,12 @@
<version>0.1.55</version>
<optional>true</optional>
</dependency>
<dependency>
<!-- TODO: after upgrading jenkins.version >= 2.171, migrate dependency -->
<groupId>io.jenkins.temp.jelly</groupId>
jvz marked this conversation as resolved.
Show resolved Hide resolved
<artifactId>multiline-secrets-ui</artifactId>
<version>1.0</version>
</dependency>
<!-- plugin dependencies -->
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,13 @@ public static class DirectEntryPrivateKeySource extends PrivateKeySource impleme

private final Secret privateKey;

@DataBoundConstructor
public DirectEntryPrivateKeySource(String privateKey) {
this.privateKey = Secret.fromString(privateKey);
this(Secret.fromString(privateKey));
}

@DataBoundConstructor
public DirectEntryPrivateKeySource(Secret privateKey) {
this.privateKey = privateKey;
}

public DirectEntryPrivateKeySource(List<String> privateKeys) {
Expand All @@ -337,8 +341,8 @@ public List<String> getPrivateKeys() {
* @return the private key.
*/
@SuppressWarnings("unused") // used by Jelly EL
public String getPrivateKey() {
return Secret.toString(privateKey);
public Secret getPrivateKey() {
jvz marked this conversation as resolved.
Show resolved Hide resolved
return privateKey;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form">
<f:entry title="${%Key}" field="privateKey">
<f:textarea/>
<secretTextarea xmlns="/io/jenkins/temp/jelly"/>
</f:entry>
</j:jelly>