package awscdkapigatewayv2authorizersalpha import ( "github.com/aws/aws-cdk-go/awscdk/v2" ) // Properties to initialize HttpTokenAuthorizer. // // Example: // import "github.com/aws/aws-cdk-go/awscdkapigatewayv2authorizersalpha" // import "github.com/aws/aws-cdk-go/awscdkapigatewayv2integrationsalpha" // // // This function handles your auth logic // var authHandler function // // // authorizer := awscdkapigatewayv2authorizersalpha.NewHttpLambdaAuthorizer(jsii.String("BooksAuthorizer"), authHandler, &HttpLambdaAuthorizerProps{ // ResponseTypes: []httpLambdaResponseType{ // awscdkapigatewayv2authorizersalpha.HttpLambdaResponseType_SIMPLE, // }, // }) // // api := apigwv2.NewHttpApi(this, jsii.String("HttpApi")) // // api.AddRoutes(&AddRoutesOptions{ // Integration: awscdkapigatewayv2integrationsalpha.NewHttpUrlIntegration(jsii.String("BooksIntegration"), jsii.String("https://get-books-proxy.example.com")), // Path: jsii.String("/books"), // Authorizer: Authorizer, // }) // // Experimental. type HttpLambdaAuthorizerProps struct { // Friendly authorizer name. // Experimental. AuthorizerName *string `field:"optional" json:"authorizerName" yaml:"authorizerName"` // The identity source for which authorization is requested. // Experimental. IdentitySource *[]*string `field:"optional" json:"identitySource" yaml:"identitySource"` // The types of responses the lambda can return. // // If HttpLambdaResponseType.SIMPLE is included then // response format 2.0 will be used. // See: https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-lambda-authorizer.html#http-api-lambda-authorizer.payload-format-response // // Experimental. ResponseTypes *[]HttpLambdaResponseType `field:"optional" json:"responseTypes" yaml:"responseTypes"` // How long APIGateway should cache the results. // // Max 1 hour. // Disable caching by setting this to `Duration.seconds(0)`. // Experimental. ResultsCacheTtl awscdk.Duration `field:"optional" json:"resultsCacheTtl" yaml:"resultsCacheTtl"` }