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

simplify UI and exposed Data model #36

Closed
wants to merge 2 commits into from
Closed

simplify UI and exposed Data model #36

wants to merge 2 commits into from

Conversation

ndeloof
Copy link
Contributor

@ndeloof ndeloof commented Nov 8, 2018

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

* @param passphrase the password.
* @param description the description.
*/
@DataBoundConstructor
public BasicSSHUserPrivateKey(CredentialsScope scope, String id, String username, String privateKey,
String passphrase,
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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);
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also deprecate PrivateKeySourceDescriptor.

Copy link
Contributor Author

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad

@jglick
Copy link
Member

jglick commented Nov 8, 2018

BTW merge with master to make CI builds work.

As only directly entered key is supported for SECURITY-440

Signed-off-by: Nicolas De Loof <[email protected]>
@jetersen
Copy link
Member

jetersen commented Apr 24, 2019

@jvz looks like this two PR did the same work #39 and #40? So we can close this one?

@jvz
Copy link
Member

jvz commented Apr 24, 2019

Thanks, you're right.

@jvz jvz closed this Apr 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants