Class AuthorizerIndex

  • All Implemented Interfaces:
    KnowledgeIndex

    public final class AuthorizerIndex
    extends java.lang.Object
    implements KnowledgeIndex
    Computes the effective authorizers of each resource and operation in a service.

    An effective authorizer of an operation first checks if the operation has the authorizer trait, then the resource an operation is bound to, then the service.

    • Constructor Detail

      • AuthorizerIndex

        public AuthorizerIndex​(Model model)
    • Method Detail

      • getAuthorizer

        public java.util.Optional<java.lang.String> getAuthorizer​(ToShapeId service,
                                                                  ToShapeId shape)
        Gets the effective authorizer name of a specific resource or operation within a service.
        Parameters:
        service - Service shape to query.
        shape - Resource or operation shape ID to query.
        Returns:
        Returns the optionally resolved authorizer name.
      • getAuthorizer

        public java.util.Optional<java.lang.String> getAuthorizer​(ToShapeId service)
        Gets the effective authorizer name of a service.
        Parameters:
        service - Service shape to query.
        Returns:
        Returns the optionally resolved authorizer name.
      • getAuthorizerValue

        public java.util.Optional<AuthorizerDefinition> getAuthorizerValue​(ToShapeId service)
        Gets the effective authorizer structure value of a service.
        Parameters:
        service - Service shape to query.
        Returns:
        Returns the optionally resolved authorizer name.
      • getAuthorizerValue

        public java.util.Optional<AuthorizerDefinition> getAuthorizerValue​(ToShapeId service,
                                                                           ToShapeId shape)
        Gets the effective authorizer structure value of a shape in a service.
        Parameters:
        service - Service shape to query.
        shape - Shape to get the authorizer of within the service.
        Returns:
        Returns the optionally resolved authorizer name.