Class DefaultRequestAuthorizer
java.lang.Object
no.unit.commons.apigateway.authentication.RequestAuthorizer
no.unit.commons.apigateway.authentication.DefaultRequestAuthorizer
- All Implemented Interfaces:
com.amazonaws.services.lambda.runtime.RequestHandler<com.amazonaws.services.lambda.runtime.events.APIGatewayCustomAuthorizerEvent,AuthorizerResponse>
A simple Lambda Authorizer. The class can be used by extending it and adding in the default constructor the principal
id value.
-
Field Summary
FieldsFields inherited from class no.unit.commons.apigateway.authentication.RequestAuthorizer
ALL_PATHS, ALLOW_EFFECT, ANY_HTTP_METHOD, ANY_RESOURCE, API_GATEWAY_IDENTIFIER_INDEX, AUTHORIZATION_HEADER, COULD_NOT_READ_PRINCIPAL_ID_ERROR, EXECUTE_API_ACTION, PATH_DELIMITER, STAGE_INDEX -
Constructor Summary
ConstructorsConstructorDescriptionDefaultRequestAuthorizer(String principalId) The constructor that should be inherited by the default constructor of the custom Lambda Authorizer.DefaultRequestAuthorizer(software.amazon.awssdk.services.secretsmanager.SecretsManagerClient secretsClient, String principalId) -
Method Summary
Methods inherited from class no.unit.commons.apigateway.authentication.RequestAuthorizer
callerIsAllowedToPerformAction, createAllowAuthPolicy, createDenyAuthPolicy, formatPolicyResource, handleRequest
-
Field Details
-
API_KEY_SECRET_NAME
-
API_KEY_SECRET_KEY
-
-
Constructor Details
-
DefaultRequestAuthorizer
The constructor that should be inherited by the default constructor of the custom Lambda Authorizer.- Parameters:
principalId- A string describing the service tha is using the Authorizer.
-
DefaultRequestAuthorizer
public DefaultRequestAuthorizer(software.amazon.awssdk.services.secretsmanager.SecretsManagerClient secretsClient, String principalId)
-
-
Method Details
-
principalId
- Specified by:
principalIdin classRequestAuthorizer
-
fetchSecret
- Specified by:
fetchSecretin classRequestAuthorizer
-