Skip to content

Add support to resolve credentials from settings.xml#1362

Merged
marcingrzejszczak merged 2 commits intospring-cloud:masterfrom
eddumelendez:gh-1350
Apr 3, 2020
Merged

Add support to resolve credentials from settings.xml#1362
marcingrzejszczak merged 2 commits intospring-cloud:masterfrom
eddumelendez:gh-1350

Conversation

@eddumelendez
Copy link
Copy Markdown
Contributor

No description provided.

@marcingrzejszczak
Copy link
Copy Markdown
Contributor

Hey @eddumelendez ! Thanks for the PR :) Do you think you could write a test for that? You could create a settings.xml file somewhere in the test resources of the plugin and assert that we're actually able to decipher that value. What do you think?

@eddumelendez
Copy link
Copy Markdown
Contributor Author

sure, I will!

@eddumelendez
Copy link
Copy Markdown
Contributor Author

@marcingrzejszczak I have submit an additional commit with a test not sure if that is enough but TBH it was an interesting one many fixes 😃

Copy link
Copy Markdown
Contributor

@marcingrzejszczak marcingrzejszczak left a comment

Choose a reason for hiding this comment

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

LGTM - had one small question though

private void setField(Class<?> sourceClass, String fieldName, Object target,
Object value) {
try {
Field field = sourceClass.getDeclaredField(fieldName);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wow, why do we have to do this?

Copy link
Copy Markdown
Contributor Author

@eddumelendez eddumelendez Apr 3, 2020

Choose a reason for hiding this comment

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

it is because DefaultSettingsDecrypter relies on maven so it will work for the maven plugin but not out of it.

Took inspiration from here

@marcingrzejszczak marcingrzejszczak added this to the 3.0.0.M1 milestone Apr 3, 2020
@marcingrzejszczak marcingrzejszczak merged commit b500bc7 into spring-cloud:master Apr 3, 2020
@marcingrzejszczak
Copy link
Copy Markdown
Contributor

Thank you @eddumelendez. As usual, great job! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants