-
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
Improve Security documentation #10483
Comments
@MarcusBiel Hi, I'd actually consider it a bug given that the method specific
It is really inconsistent if we have
@stuartwdouglas Hi Stuart, do you agree ? IMHO we have to fix it...Thanks |
I'm not 100% sure, given this RolesAllowed text, if a method specific role like |
@MarcusBiel Can you provide a reproducer? I just checked and we do reject this configuration, you should get an error like:
|
Hi Stuart, should we instead follow a |
What error are we actually seeing? Method level annotations definitely override class level ones, and this is tested, so I really need to see a reproducer to see what the actual problem is. |
@stuartwdouglas sure, I will provide a reproducer if it helps you - but I don't think it will even be necessary. I had both annotations on class level, not method level. My assumption was - @ Authenticated says that this Resource is authenticated, and @ RolesAllowed says who actually may authenticate. Of course, the actual error is on my side - but I find those annotations rather confusing - same as @ PermitAll.
|
Interesting, OK, here is how I've been thinking about
then what I want here is to ensure that only the authenticated users can access this resource. True, it is equivalent to setting Now if I have
Then yes, I intuitively want to say,
Should work too, it is the same as (2). Having I'd only expect an error if I had
|
I think if we just drop |
Ah, I only tested duplication at the method level, looks like there is a bug in the code that detects duplication at the class level, I have opened a PR. |
(Sorry to dig up this issue:) Where is the meaning of the wildcard notation in |
The security documentation should be made CRYSTAL clear in the sense that - you must never use @authenticated and
@RolesAllowed together - even better, if such combined usage of Annotations would break at compile time.
The security documentation actually says it - but it's easy to miss this part (or it's strong implications) I think:
Quarkus comes with built-in security to allow for Role-Based Access Control (RBAC) based on the common security annotations @RolesAllowed, @Denyall, @permitAll on REST endpoints and CDI beans. An example of an endpoint that makes use of both JAX-RS and Common Security annotations to describe and secure its endpoints is given in SubjectExposingResource Example. Quarkus also provides the io.quarkus.security.Authenticated annotation that will permit any authenticated user to access the resource (equivalent to @RolesAllowed("**")).
I found this as a bug in my code through integration testing. All my ADMIN endpoints where available open to any kind of authenticated user.
The text was updated successfully, but these errors were encountered: