Skip to content

Commit

Permalink
Merge pull request #40 from jvz/secret-textarea-ui
Browse files Browse the repository at this point in the history
Use secretTextarea for SSH key UI
  • Loading branch information
jvz authored Apr 22, 2019
2 parents 3800eb4 + 4fe9b86 commit 015aa53
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
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>
<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() {
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>

0 comments on commit 015aa53

Please sign in to comment.