Package io.micronaut.security.rules
Class SecuredAnnotationRule
- java.lang.Object
-
- io.micronaut.security.rules.AbstractSecurityRule
-
- io.micronaut.security.rules.SecuredAnnotationRule
-
- All Implemented Interfaces:
io.micronaut.core.order.Ordered
,SecurityRule
@Singleton public class SecuredAnnotationRule extends AbstractSecurityRule
Security rule implementation for theSecured
annotation.- Since:
- 1.0
- Author:
- James Kleeh
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.Integer
ORDER
The order of the rule.-
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Fields inherited from interface io.micronaut.security.rules.SecurityRule
DENY_ALL, IS_ANONYMOUS, IS_AUTHENTICATED
-
-
Constructor Summary
Constructors Constructor Description SecuredAnnotationRule(TokenConfiguration tokenConfiguration)
Deprecated.useSecuredAnnotationRule(RolesFinder)
instead.SecuredAnnotationRule(RolesFinder rolesFinder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SecurityRuleResult
check(io.micronaut.http.HttpRequest request, io.micronaut.web.router.RouteMatch routeMatch, java.util.Map<java.lang.String,java.lang.Object> claims)
ReturnsSecurityRuleResult.UNKNOWN
if theSecured
annotation is not found on the method or class, or if the route match is not method based.int
getOrder()
-
Methods inherited from class io.micronaut.security.rules.AbstractSecurityRule
compareRoles, getRoles
-
-
-
-
Constructor Detail
-
SecuredAnnotationRule
@Deprecated public SecuredAnnotationRule(TokenConfiguration tokenConfiguration)
Deprecated.useSecuredAnnotationRule(RolesFinder)
instead.- Parameters:
tokenConfiguration
- Token Configuration.
-
SecuredAnnotationRule
@Inject public SecuredAnnotationRule(RolesFinder rolesFinder)
- Parameters:
rolesFinder
- Roles Parser
-
-
Method Detail
-
check
public SecurityRuleResult check(io.micronaut.http.HttpRequest request, @Nullable io.micronaut.web.router.RouteMatch routeMatch, @Nullable java.util.Map<java.lang.String,java.lang.Object> claims)
ReturnsSecurityRuleResult.UNKNOWN
if theSecured
annotation is not found on the method or class, or if the route match is not method based.- Parameters:
request
- The current requestrouteMatch
- The matched routeclaims
- The claims from the token. Null if not authenticated- Returns:
- The result
- See Also:
SecurityRuleResult
-
getOrder
public int getOrder()
-
-