
public class DefaultAssertionRequiredPredicate extends Object implements JwtAssertionRequiredPredicate
However, the default is to require the assertion if nothing has been specified.
This will throw an IllegalArgumentException if both RolesAllowed and
PermitAll are present in a class or method.
| Modifier and Type | Field and Description |
|---|---|
private static org.slf4j.Logger |
LOG |
| Constructor and Description |
|---|
DefaultAssertionRequiredPredicate() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
test(javax.ws.rs.container.ResourceInfo resourceInfo)
The key logic for the test is as follows:
|
public boolean test(javax.ws.rs.container.ResourceInfo resourceInfo)
The key logic for the test is as follows:
Let:
| a = | resourceMethodHasRolesAllowed |
| b = | resourceClassHasRolesAllowed |
| c = | resourceMethodHasPermitAll |
| d = | resourceClassHasPermitAll |
The rules that need to be applied translate to:
= a || ( b && !c ) || ( !a && !b && !c && !d ) = (a || b || !d) && ( a || !c )
Copyright © 2012–2018 Trajano. All rights reserved.