Class DefaultRequestAuthorizer
- java.lang.Object
-
- nva.commons.apigateway.RestRequestHandler<java.lang.Void,AuthorizerResponse>
-
- no.unit.commons.apigateway.authentication.RequestAuthorizer
-
- no.unit.commons.apigateway.authentication.DefaultRequestAuthorizer
-
- All Implemented Interfaces:
com.amazonaws.services.lambda.runtime.RequestStreamHandler
public class DefaultRequestAuthorizer extends RequestAuthorizer
A simple Lambda Authorizer. The class can be used by extending it and adding in the default constructor the principal id value.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAPI_KEY_SECRET_KEYstatic java.lang.StringAPI_KEY_SECRET_NAME-
Fields inherited from class no.unit.commons.apigateway.authentication.RequestAuthorizer
ALL_PATHS, ALLOW_EFFECT, ANY_HTTP_METHOD, ANY_RESOURCE, API_GATEWAY_IDENTIFIER_INDEX, AUTHORIZATION_HEADER, EXECUTE_API_ACTION, PATH_DELIMITER, STAGE_INDEX
-
-
Constructor Summary
Constructors Constructor Description DefaultRequestAuthorizer(java.lang.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, java.lang.String principalId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringfetchSecret()protected java.lang.StringprincipalId()-
Methods inherited from class no.unit.commons.apigateway.authentication.RequestAuthorizer
createAllowAuthPolicy, createDenyAuthPolicy, formatPolicyResource, getSuccessStatusCode, processInput, secretCheck, writeExpectedFailure, writeOutput, writeUnexpectedFailure
-
Methods inherited from class nva.commons.apigateway.RestRequestHandler
calculateContentTypeHeaderReturnValue, findMediaTypeMatches, getDefaultResponseContentTypeHeaderValue, getFailureStatusCode, handleExpectedException, handleRequest, handleUnexpectedException, init, listSupportedMediaTypes, parseInput, parsingExceptionToBadRequestException
-
-
-
-
Constructor Detail
-
DefaultRequestAuthorizer
public DefaultRequestAuthorizer(java.lang.String principalId)
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, java.lang.String principalId)
-
-
Method Detail
-
principalId
protected java.lang.String principalId()
- Specified by:
principalIdin classRequestAuthorizer
-
fetchSecret
protected java.lang.String fetchSecret()
- Specified by:
fetchSecretin classRequestAuthorizer
-
-