/** * This lambda verifies authorization header against static basic auth credentials saved in Secrets * Manager. * * Expects the following environment variables: * - CREDENTIALS_SECRET_NAME * - Name of secret in AWS Secrets Manager that stores basic auth credentials. See * `BasicAuthAuthorizerProps` on the `ApiGateway` construct for the supported formats. */ import { SecretsManager } from "@aws-sdk/client-secrets-manager"; import type { APIGatewayRequestAuthorizerEventV2, APIGatewaySimpleAuthorizerResult } from "aws-lambda"; type AuthorizerResult = APIGatewaySimpleAuthorizerResult & { /** * Returning a context object from our authorizer allows our API Gateway to access these variables * via `${context.authorizer.}`. * https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-parameter-mapping.html */ context?: { /** * If the request's credentials are verified, we return the username that was used in this * context variable (named `authorizer.username`). We use this to include the requesting user in * the API Gateway access logs (see `defaultAccessLogFormat` in our `ApiGateway` construct). You * can also use this when mapping parameters to the backend integration (see * `AlbIntegrationProps.mapParameters` on the `ApiGateway` construct). */ username: string; }; }; export declare const handler: (event: APIGatewayRequestAuthorizerEventV2) => Promise; /** For overriding dependency creation in tests. */ export declare const dependencies: { createSecretsManager: () => SecretsManager; }; export declare function clearCache(): void; export {};