Collection of utility functions / helpers to help with building Api Gateway Lambda Authorizer easier with Typescript
yarn add @distinction-dev/lambda-authorizer-utils
-
Verifiers
-
Utils
import { AuthorizerResponse } from "@distinction-dev/lambda-authorizer-utils";
export const authorizer = (event: APIGatewayRequestAuthorizerEvent) => {
const response = new AuthorizerResponse(
"<principal_id>",
"<aws_region>",
"<aws_account_id>",
"<api_id>",
"<api_stage>"
);
response.addRoute("GET", "/test");
return response.getPolicy();
};
Full docs here