public final class AuthorizerIndex extends java.lang.Object implements KnowledgeIndex
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 and Description |
---|
AuthorizerIndex(Model model) |
Modifier and Type | Method and Description |
---|---|
java.util.Optional<java.lang.String> |
getAuthorizer(ToShapeId service)
Gets the effective authorizer name of a service.
|
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.
|
java.util.Optional<AuthorizerDefinition> |
getAuthorizerValue(ToShapeId service)
Gets the effective authorizer structure value of a service.
|
java.util.Optional<AuthorizerDefinition> |
getAuthorizerValue(ToShapeId service,
ToShapeId shape)
Gets the effective authorizer structure value of a shape in a service.
|
static AuthorizerIndex |
of(Model model) |
public AuthorizerIndex(Model model)
public static AuthorizerIndex of(Model model)
public java.util.Optional<java.lang.String> getAuthorizer(ToShapeId service, ToShapeId shape)
service
- Service shape to query.shape
- Resource or operation shape ID to query.public java.util.Optional<java.lang.String> getAuthorizer(ToShapeId service)
service
- Service shape to query.public java.util.Optional<AuthorizerDefinition> getAuthorizerValue(ToShapeId service)
service
- Service shape to query.public java.util.Optional<AuthorizerDefinition> getAuthorizerValue(ToShapeId service, ToShapeId shape)
service
- Service shape to query.shape
- Shape to get the authorizer of within the service.