-
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
Support Smallrye Config property expression expansion for @RolesAllowed value #29935
Support Smallrye Config property expression expansion for @RolesAllowed value #29935
Conversation
This comment has been minimized.
This comment has been minimized.
c0a3361
to
604755f
Compare
This comment has been minimized.
This comment has been minimized.
docs/src/main/asciidoc/security-authorization-of-web-endpoints-reference.adoc
Outdated
Show resolved
Hide resolved
...-http/runtime/src/main/java/io/quarkus/vertx/http/runtime/security/HttpSecurityRecorder.java
Outdated
Show resolved
Hide resolved
integration-tests/elytron-resteasy-reactive/src/main/resources/application.properties
Show resolved
Hide resolved
9d1f113
to
8badc44
Compare
docs/src/main/asciidoc/security-authorization-of-web-endpoints-reference.adoc
Outdated
Show resolved
Hide resolved
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.
@michalvavrik This is a nice feature to have, thanks, please look at the last single comment.
Let @stuartwdouglas to have a quick look if he gets a chance, I'll merge tomorrow, Stuart, it can be tweaked as always if you notice something
8badc44
to
8974be6
Compare
This comment has been minimized.
This comment has been minimized.
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.
Just a few thoughts:
Did you consider generating a configuration source with generated keys and values with the property expressions? The source could be registered with the Config system, and you would get all features available from Config and not only expansion.
Another idea could be to support configuration properties, and instead of the expansion, we do a complete config lookup (which, of course, also supports expansion).
I didn't think of that, I actually took identical approach as Scheduler extension, but I like that very much. @sberyozkin I think Roberto's suggestion is going to be less prone to (future) compatibility issues and and we get Smallrye Config improvements for free with next Smallrye Config versions. I'll have a look at this, please hold with merging till I investigate how to do it, it shouldn't take long. Thank you |
Okay, I found a way, I'll do it tomorrow. |
Thanks @radcortez, @michalvavrik Sure, take your time please. |
Great! Here are some specific ideas. Feel free to take them or discard them :) @RolesAllowed("security.role")
void single() {
}
@RolesAllowed("security.roles")
void multiple() {
}
@RolesAllowed("security.expressiom")
void expression() {
}
@RolesAllowed("actualRole") // We cannot find in in Config, so we use the value as is
void noConfig() {
} security.role=role
security.roles=role1,role2
#or
security.role[0]=role1
security.role[1]=role2
security.expression=role_${number}
number=1 |
8974be6
to
c4360ff
Compare
I used your suggestion to generate a configuration source with generated keys and values with the property expressions and also to use And I kept previous behavior - I don't consider all Thank you very much for help |
Yes, I'm aware of this. The issue is that the builders are expected to be available in the bootstrap classloader (the |
Thanks Michal, Roberto |
@sberyozkin @michalvavrik this seems to have broken For example
|
#30220 should fix the issue |
closes: #25245
Support SmallRye Config property expressions expansion for the
@RolesAllowed
annotation value.