UNPKG

aws-cdk-lib

Version:

Version 2 of the AWS Cloud Development Kit library

2 lines (1 loc) 823 B
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.HttpJwtAuthorizer=void 0;var aws_apigatewayv2_1=()=>{var tmp=require("../../../aws-apigatewayv2");return aws_apigatewayv2_1=()=>tmp,tmp};class HttpJwtAuthorizer{constructor(id,jwtIssuer,props){this.id=id,this.jwtIssuer=jwtIssuer,this.props=props}bind(options){return this.authorizer||(this.authorizer=new(aws_apigatewayv2_1()).HttpAuthorizer(options.scope,this.id,{httpApi:options.route.httpApi,identitySource:this.props.identitySource??["$request.header.Authorization"],type:aws_apigatewayv2_1().HttpAuthorizerType.JWT,authorizerName:this.props.authorizerName??this.id,jwtAudience:this.props.jwtAudience,jwtIssuer:this.jwtIssuer})),{authorizerId:this.authorizer.authorizerId,authorizationType:"JWT"}}}exports.HttpJwtAuthorizer=HttpJwtAuthorizer;