class HttpNoneAuthorizer
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.APIGatewayv2.HttpNoneAuthorizer |
![]() | software.amazon.awscdk.services.apigatewayv2.HttpNoneAuthorizer |
![]() | aws_cdk.aws_apigatewayv2.HttpNoneAuthorizer |
![]() | @aws-cdk/aws-apigatewayv2 » HttpNoneAuthorizer |
Implements
IHttp
Explicitly configure no authorizers on specific HTTP API routes.
Example
import { HttpJwtAuthorizer } from '@aws-cdk/aws-apigatewayv2-authorizers';
import { HttpUrlIntegration } from '@aws-cdk/aws-apigatewayv2-integrations';
const issuer = 'https://test.us.auth0.com';
const authorizer = new HttpJwtAuthorizer('DefaultAuthorizer', issuer, {
jwtAudience: ['3131231'],
});
const api = new apigwv2.HttpApi(this, 'HttpApi', {
defaultAuthorizer: authorizer,
defaultAuthorizationScopes: ['read:books'],
});
api.addRoutes({
integration: new HttpUrlIntegration('BooksIntegration', 'https://get-books-proxy.myproxy.internal'),
path: '/books',
methods: [apigwv2.HttpMethod.GET],
});
api.addRoutes({
integration: new HttpUrlIntegration('BooksIdIntegration', 'https://get-books-proxy.myproxy.internal'),
path: '/books/{id}',
methods: [apigwv2.HttpMethod.GET],
});
api.addRoutes({
integration: new HttpUrlIntegration('BooksIntegration', 'https://get-books-proxy.myproxy.internal'),
path: '/books',
methods: [apigwv2.HttpMethod.POST],
authorizationScopes: ['write:books']
});
api.addRoutes({
integration: new HttpUrlIntegration('LoginIntegration', 'https://get-books-proxy.myproxy.internal'),
path: '/login',
methods: [apigwv2.HttpMethod.POST],
authorizer: new apigwv2.HttpNoneAuthorizer(),
});
Initializer
new HttpNoneAuthorizer()
Methods
Name | Description |
---|---|
bind(_) | Bind this authorizer to a specified Http route. |
bind(_)
public bind(_: HttpRouteAuthorizerBindOptions): HttpRouteAuthorizerConfig
Parameters
Returns
Bind this authorizer to a specified Http route.