@aws-cdk_aws-apigatewayv2-alpha.HttpNoneAuthorizer

class HttpNoneAuthorizer 🔹

LanguageType name
.NETAmazon.CDK.AWS.Apigatewayv2.Alpha.HttpNoneAuthorizer
Gogithub.com/aws/aws-cdk-go/awscdkapigatewayv2alpha/v2#HttpNoneAuthorizer
Javasoftware.amazon.awscdk.services.apigatewayv2.alpha.HttpNoneAuthorizer
Pythonaws_cdk.aws_apigatewayv2_alpha.HttpNoneAuthorizer
TypeScript (source)@aws-cdk/aws-apigatewayv2-alpha » HttpNoneAuthorizer

Implements IHttpRouteAuthorizer

Explicitly configure no authorizers on specific HTTP API routes.

Example

import { HttpJwtAuthorizer } from '@aws-cdk/aws-apigatewayv2-authorizers-alpha';
import { HttpUrlIntegration } from '@aws-cdk/aws-apigatewayv2-integrations-alpha';

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.example.com'),
  path: '/books',
  methods: [apigwv2.HttpMethod.GET],
});

api.addRoutes({
  integration: new HttpUrlIntegration('BooksIdIntegration', 'https://get-books-proxy.example.com'),
  path: '/books/{id}',
  methods: [apigwv2.HttpMethod.GET],
});

api.addRoutes({
  integration: new HttpUrlIntegration('BooksIntegration', 'https://get-books-proxy.example.com'),
  path: '/books',
  methods: [apigwv2.HttpMethod.POST],
  authorizationScopes: ['write:books']
});

api.addRoutes({
  integration: new HttpUrlIntegration('LoginIntegration', 'https://get-books-proxy.example.com'),
  path: '/login',
  methods: [apigwv2.HttpMethod.POST],
  authorizer: new apigwv2.HttpNoneAuthorizer(),
});

Initializer

new HttpNoneAuthorizer()

Methods

NameDescription
bind(_options)🔹Bind this authorizer to a specified Http route.

bind(_options)🔹

public bind(_options: HttpRouteAuthorizerBindOptions): HttpRouteAuthorizerConfig

Parameters

  • _options HttpRouteAuthorizerBindOptions

Returns

  • HttpRouteAuthorizerConfig

Bind this authorizer to a specified Http route.