Skip to content
Permalink
Browse files

[JENKINS-26099] Permit BasicSSHUserPrivateKey.id to be configured.

  • Loading branch information
jglick committed Jan 14, 2015
1 parent 631a29c commit ab9245809aa854544d144c90a4ca4835cdafb4f9
@@ -96,7 +96,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>credentials</artifactId>
<version>1.16.1</version>
<version>1.21-20150114.010642-1</version>
</dependency>
<!-- jenkins dependencies -->
<!-- test dependencies -->
@@ -24,7 +24,6 @@
package com.cloudbees.jenkins.plugins.sshcredentials.impl;

import com.cloudbees.jenkins.plugins.sshcredentials.SSHUserPrivateKey;
import com.cloudbees.plugins.credentials.CredentialsDescriptor;
import com.cloudbees.plugins.credentials.CredentialsProvider;
import com.cloudbees.plugins.credentials.CredentialsScope;
import com.cloudbees.plugins.credentials.CredentialsSnapshotTaker;
@@ -166,7 +165,7 @@ public Secret getPassphrase() {
* {@inheritDoc}
*/
@Extension
public static class DescriptorImpl extends CredentialsDescriptor {
public static class DescriptorImpl extends BaseStandardCredentialsDescriptor {

/**
* {@inheritDoc}
@@ -180,12 +179,6 @@ public String getDisplayName() {
return Hudson.getInstance().getDescriptorList(PrivateKeySource.class);
}

public BasicSSHUserPrivateKey fixInstance(BasicSSHUserPrivateKey instance) {
return instance == null ? new BasicSSHUserPrivateKey(CredentialsScope.GLOBAL, null, "",
new DirectEntryPrivateKeySource(""), "",

"") : instance;
}
}

/**
@@ -24,24 +24,15 @@
-->

<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form" xmlns:st="jelly:stapler">
<f:invisibleEntry>
<f:textbox style="display:none" field="id"/>
</f:invisibleEntry>
<j:if test="${instance==null}">
<j:set var="instance" value="${descriptor.fixInstance(instance)}"/>
</j:if>
<f:entry title="${%Username}" field="username">
<f:textbox/>
</f:entry>
<f:entry title="${%Description}" field="description">
<f:textbox/>
</f:entry>
<f:entry title="${%Private Key}" field="privateKeySource">
<!-- TODO switch back to hetero-radio when the initial expansion bug is fixed -->
<j:scope>
<table style="width:100%">
<j:set var="currentInstance" value="${instance.privateKeySource}" />
<j:set var="currentDescriptor" value="${currentInstance.descriptor}" />
<j:set var="currentInstance" value="${instance != null ? instance.privateKeySource : null}"/>
<j:set var="currentDescriptor" value="${currentInstance != null ? currentInstance.descriptor : null}"/>
<j:set var="currentName" value="${h.generateId()}.privateKeySource" />
<j:forEach var="d" items="${descriptor.privateKeySources}" varStatus="loop">
<f:radioBlock name="${currentName}" help="${d.helpFile}" value="${loop.index}"
@@ -57,9 +48,8 @@
</table>
</j:scope>
</f:entry>
<f:advanced>
<f:entry title="${%Passphrase}" field="passphrase">
<f:password/>
</f:entry>
</f:advanced>
<f:entry title="${%Passphrase}" field="passphrase">
<f:password/>
</f:entry>
<st:include page="id-and-description" class="${descriptor.clazz}"/>
</j:jelly>
@@ -22,6 +22,5 @@
# THE SOFTWARE.

Username=Benutzername
Private\ Key=Privater Schl\u00FCssel
Private\ Key=Privater Schl\u00fcssel
Passphrase=Passwort/Passphrase
Description=Beschreibung
@@ -23,4 +23,3 @@
Username=\u30e6\u30fc\u30b6\u30fc\u540d
Private\ Key=\u79d8\u5bc6\u9375
Passphrase=\u30d1\u30b9\u30d5\u30ec\u30fc\u30ba
Description=\u8aac\u660e

0 comments on commit ab92458

Please sign in to comment.
You can’t perform that action at this time.