forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request quarkusio#19955 from geoand/quarkusio#19896
Make @testsecurity work correctly with unannotated JAX-RS endpoints security feature
- Loading branch information
Showing
3 changed files
with
12 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,8 @@ | |
import javax.interceptor.Interceptor; | ||
import javax.interceptor.InvocationContext; | ||
|
||
import io.quarkus.security.spi.runtime.AuthorizationController; | ||
|
||
/** | ||
* | ||
* @author Michal Szynkiewicz, [email protected] | ||
|
@@ -19,8 +21,15 @@ public class DenyAllInterceptor { | |
@Inject | ||
SecurityHandler handler; | ||
|
||
@Inject | ||
AuthorizationController controller; | ||
|
||
@AroundInvoke | ||
public Object intercept(InvocationContext ic) throws Exception { | ||
return handler.handle(ic); | ||
if (controller.isAuthorizationEnabled()) { | ||
return handler.handle(ic); | ||
} else { | ||
return ic.proceed(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters