-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 Sec. Identity in RESTEasy Reactive when Proactive Auth disabled #26457
Resolve Sec. Identity in RESTEasy Reactive when Proactive Auth disabled #26457
Conversation
2415439
to
f604aee
Compare
This looks fine, I'll check tomorrow with a clearer head, but it would be great if @stuartwdouglas could double check as well |
This comment has been minimized.
This comment has been minimized.
...nt/src/test/java/io/quarkus/resteasy/reactive/server/test/security/RolesAllowedResource.java
Show resolved
Hide resolved
...src/main/java/io/quarkus/resteasy/reactive/server/runtime/security/EagerSecurityHandler.java
Outdated
Show resolved
Hide resolved
@michalvavrik Sorry for a delay and thanks for the quality PR, I left a couple of minor comments. Can you also check the last paragraph in this doc section, will that still be required if an endpoint tries to access the injected Thanks |
551edd2
to
1519ffa
Compare
It's still true except when following conditions are met:
The article discusses the Quarkus Security in general (not just RR), but I've added explanatory note.
Done, good idea, thank you. |
This comment has been minimized.
This comment has been minimized.
@michalvavrik Thanks, can you please check the failing RESTEasy Reactve TCK test ? 500 is reported |
f ix quarkusio#23547 for RESTEasy Reactive cases (e.g. the issue reproducer)
1519ffa
to
513e44c
Compare
@sberyozkin I fixed typo and rebased onto the latest main - 500 is gone. |
Failing Jobs - Building 513e44c
Full information is available in the Build summary check run. Failures⚙️ JVM Tests - JDK 11 Windows #- Failing: extensions/mongodb-client/deployment
! Skipped: extensions/liquibase-mongodb/deployment extensions/panache/mongodb-panache-common/deployment extensions/panache/mongodb-panache-kotlin/deployment and 8 more 📦 extensions/mongodb-client/deployment✖
✖
|
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 @michalvavrik
…fix-securityconstrainer-blocking-op-exception" This reverts commit 4491639.
f ix #23547 for RESTEasy Reactive cases (e.g. the issue reproducer)
Disabling proactive authentication makes accessing the
SecurityIdentity
the blocking operation. In RR security checks for these of standard security annotations that requires access toSecurityIdentity
(e.g.@RollesAllowed
) are further up the handler chain then same checks run by Quarkus Security Runtime (io.quarkus.security.deployment.SecurityProcessor#registerSecurityInterceptors
). Checks run in RR access SecurityIndentity bygetDeferredIdentity
(non-blocking), however in Quarkus Security the checks are usinggetIdentity
. That leads toBlockingOperationNotAllowedException
when running synchronously on IO thread. Thequarkus-security-runtime-spi
does not allow to disable security checks (that make sense from security point of view, but f.eio.quarkus.security.runtime.interceptor.check.RolesAllowedCheck
is always run twice if successful), but as checks in RR always run first, this PR sets the identity there to make it available later in the chain.