Class AuthorizerIndex

java.lang.Object
software.amazon.smithy.aws.apigateway.traits.AuthorizerIndex
All Implemented Interfaces:
KnowledgeIndex

public final class AuthorizerIndex extends 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 Details

    • AuthorizerIndex

      public AuthorizerIndex(Model model)
  • Method Details

    • of

      public static AuthorizerIndex of(Model model)
    • getAuthorizer

      public Optional<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 Optional<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 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 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.