-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Resolve oauth2 client-id, client-secret placeholders #8880
Conversation
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.
Thanks for the PR @evgeniycheban. Please see my one comment.
@@ -104,8 +105,10 @@ public BeanDefinition parse(Element element, ParserContext parserContext) { | |||
} | |||
} | |||
getOptionalIfNotEmpty(clientRegistrationElt.getAttribute(ATT_CLIENT_ID)) | |||
.map(parserContext.getReaderContext().getEnvironment()::resolvePlaceholders) |
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.
There may be other placeholders that need to be resolved other than client-id
and client-secret
and I would like to avoid adding parserContext.getReaderContext().getEnvironment()::resolvePlaceholders
to every element.
If you look at this commit, could we simply register a org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
@Bean
to take care of it?
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.
Thanks for the review @jgrandja.
In this case, we do not register ClientRegistration
as a bean, so we need to manually resolve property placeholders.
Maybe it would be better to move parserContext.getReaderContext().getEnvironment()::resolvePlaceholders
to getOptionalIfNotEmpty
method?
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.
Yes you are right @evgeniycheban - ClientRegistration
are not beans so that won't work.
Maybe it would be better to move
parserContext.getReaderContext().getEnvironment()::resolvePlaceholders
togetOptionalIfNotEmpty
method?
Agreed.
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.
Done.
2f9069c
to
bca066d
Compare
4482e8a
to
b0f45d8
Compare
Thanks for the PR @evgeniycheban ! This is now in master. |
Closes gh-8453