Open deidzen opened 1 week ago
@deidzen While this issue is being addressed, you may want to to have a look at @PermissionChecker
in Quarkus 3.17.0.CR1:
https://quarkus.io/version/main/guides/security-authorize-web-endpoints-reference#permission-checker
We believe it offers a simpler alternative to @PreAuthorize
I see that EagerSecurityFilter class mentioned in error stacktrace was changed in 3.6.8 version (https://github.com/quarkusio/quarkus/commit/6d76eafa5c7b28d0a9854695d0590f3db969c49d#diff-fbf38214479c02a3e1bae50b5b595d13c12c28e64d34246398151ef3b521e5db). Maybe that caused the issue.
We keep changing it, that is nothing out of ordinary. I will put this issue on my (extended) list.
Describe the bug
According to documentation (https://quarkus.io/guides/spring-security#preauthorize), Quarkus supports custom bean invocation via PreAuthorize annotation before method executing
But starting from 3.6.8 version (I personally checked 3.6.8, 3.9.5 and current 3.16.3), this functionality in Quarkus RESTEasy is not working, it throws NullPointerException.
I see that EagerSecurityFilter class mentioned in error stacktrace was changed in 3.6.8 version (https://github.com/quarkusio/quarkus/commit/6d76eafa5c7b28d0a9854695d0590f3db969c49d#diff-fbf38214479c02a3e1bae50b5b595d13c12c28e64d34246398151ef3b521e5db). Maybe that caused the issue.
Expected behavior
Custom bean is invoked through @PreAuthorize annotation succesfully
Actual behavior
NPE is thrown during custom bean invocation
How to Reproduce?
Reproducer: https://github.com/deidzen/quarkus-preauthorized-test
Steps to reproduce:
mvn clean test
. 2 tests will fail with 500 errorjava.lang.NullPointerException: Cannot load from object array because "<parameter2>" is null
For compare you can switch to 3.6.7 Quarkus version (quarkus-3.6.7-resteasy branch) and try once again - tests will pass
Output of
uname -a
orver
Microsoft Windows [Version 10.0.26100.2033]
Output of
java -version
17.0.10, vendor: Oracle OpenJDK
Quarkus version or git rev
3.6.8+ (I personally checked 3.6.8, 3.9.5 and current 3.16.3)
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Additional information
No response