-
Notifications
You must be signed in to change notification settings - Fork 67
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
simplify UI and exposed Data model #36
Conversation
* @param passphrase the password. | ||
* @param description the description. | ||
*/ | ||
@DataBoundConstructor | ||
public BasicSSHUserPrivateKey(CredentialsScope scope, String id, String username, String privateKey, | ||
String passphrase, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be of type Secret
, and should be moved into a @DataBoundSetter
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, didn't want to make more changes that strictly required, but I'm fine to get one step further
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why use a DataBoundSetter ? Does it make any sense to create a SSHUserPrivateKey without a private key ?
String description) { | ||
super(scope, id, username, description); | ||
privateKey = StringUtils.trimToNull(privateKey); | ||
this.privateKeySource = privateKey == null ? null : new DirectEntryPrivateKeySource(privateKey); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would a null private key mean?
} | ||
|
||
|
||
@Deprecated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also deprecate PrivateKeySourceDescriptor
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack
@@ -26,6 +26,7 @@ | |||
import com.cloudbees.jenkins.plugins.sshcredentials.SSHUserPrivateKey; | |||
import com.cloudbees.plugins.credentials.CredentialsProvider; | |||
import com.cloudbees.plugins.credentials.CredentialsScope; | |||
import com.google.common.base.Optional; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my bad
BTW merge with |
As only directly entered key is supported for SECURITY-440 Signed-off-by: Nicolas De Loof <[email protected]>
Signed-off-by: Nicolas De Loof <[email protected]>
Thanks, you're right. |
as of SECURITY-440 only directly entered private key is supported, others legacy flavours are automatically migrated. This PR do simplify the UI to only expose this directly entered key as a single textarea field.
It also make exposed data model cleaner, typically configuration-as-code would avoid a deep nested model to define private key