-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Optional configuration groups do not work #7862
Comments
I guess
would also be fine, |
First, initializing config properties is never necessary and you'll never observe a null config property (assuming everything is working correctly). Second, we don't have any support for mutually exclusive properties at a config level, so that has to be done manually (or better yet, find a model that doesn't require mutual exclusion). Other than that, it seems something has gotten broken here, which is odd because I was sure that we had tests for these cases. What |
@dmlloyd I'm sorry, I've missed your question. I'll check asap and update |
For the record, I also tried to use optional config groups for my datasource PR and I got some very weird issues. It was totally in the way and I already got other blocking issues in the way so worked around it. |
Looks like this issue is related, #8464 See https://github.com/quarkusio/quarkus/blob/master/extensions/keycloak-authorization/runtime/src/main/java/io/quarkus/keycloak/pep/runtime/KeycloakPolicyEnforcerConfig.java#L59. |
Any updates on this? |
Describe the bug
When I was working on updating
quarkus-oidc
OidcTenantResolver to support different client secret methods, we ended agreeing with @pedroigor on the following as an initial step:Note
clientSecret
has to be initialized immediately andSecret
properties are optional, because all immediateCredentials
properties (secret
,clientSecret
and more later on) are mutually exclusive.I tried:
which looks nicer IMHO, and would've let me to just do
if clientSecret.isPresent()
instead of checking all ofSecret
properties if any of them has been unnecessarily set.Expected behavior
It would super great if optional configuration groups were supported
Actual behavior
When I tried
Optional<Secret> clientSecret
and configuredI got an exception (it was a class cast to
Optional
), I can find out....It can be tricky to fix I guess, may be if at least one of a given optional group's properties is set then initialize and treat all other non initialized required properties in this group as optional because the group itself is optional
To Reproduce
See above
The text was updated successfully, but these errors were encountered: