Class SecuredAnnotationRule

  • All Implemented Interfaces:
    io.micronaut.core.order.Ordered, SecurityRule

    @Singleton
    public class SecuredAnnotationRule
    extends AbstractSecurityRule
    Security rule implementation for the Secured annotation.
    Since:
    1.0
    Author:
    James Kleeh
    • Field Detail

      • ORDER

        public static final java.lang.Integer ORDER
        The order of the rule.
    • 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)
        Returns SecurityRuleResult.UNKNOWN if the Secured annotation is not found on the method or class, or if the route match is not method based.
        Parameters:
        request - The current request
        routeMatch - The matched route
        claims - The claims from the token. Null if not authenticated
        Returns:
        The result
        See Also:
        SecurityRuleResult
      • getOrder

        public int getOrder()