From 089b27728c4434474055c9932d534c1883c1d809 Mon Sep 17 00:00:00 2001 From: go-to-k <24818752+go-to-k@users.noreply.github.com> Date: Tue, 19 Dec 2023 01:17:34 +0900 Subject: [PATCH 1/2] chore(apigateway): fix typo in a doc and a private method for lambda authorizers --- .../aws-cdk-lib/aws-apigateway/lib/authorizers/lambda.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/aws-cdk-lib/aws-apigateway/lib/authorizers/lambda.ts b/packages/aws-cdk-lib/aws-apigateway/lib/authorizers/lambda.ts index 727c0392c8d68..b9bd100af0acb 100644 --- a/packages/aws-cdk-lib/aws-apigateway/lib/authorizers/lambda.ts +++ b/packages/aws-cdk-lib/aws-apigateway/lib/authorizers/lambda.ts @@ -123,7 +123,7 @@ abstract class LambdaAuthorizer extends Authorizer implements IAuthorizer { */ protected setupPermissions() { if (!this.role) { - this.addDefaultPermisionRole(); + this.addDefaultPermissionRole(); } else if (iam.Role.isRole(this.role)) { this.addLambdaInvokePermission(this.role); } @@ -132,7 +132,7 @@ abstract class LambdaAuthorizer extends Authorizer implements IAuthorizer { /** * Add Default Permission Role for handler */ - private addDefaultPermisionRole() :void { + private addDefaultPermissionRole() :void { this.handler.addPermission(`${Names.uniqueId(this)}:Permissions`, { principal: new iam.ServicePrincipal('apigateway.amazonaws.com'), sourceArn: this.authorizerArn, @@ -140,7 +140,7 @@ abstract class LambdaAuthorizer extends Authorizer implements IAuthorizer { } /** - * Add Lambda Invoke Permission for LambdaAurhorizer's role + * Add Lambda Invoke Permission for Lambda Authorizer's role */ private addLambdaInvokePermission(role: iam.Role) :void { role.attachInlinePolicy(new iam.Policy(this, 'authorizerInvokePolicy', { From 00876fec9d6a8b16390e01522f87edd32446294a Mon Sep 17 00:00:00 2001 From: Kaizen Conroy <36202692+kaizencc@users.noreply.github.com> Date: Mon, 18 Dec 2023 08:39:27 -0800 Subject: [PATCH 2/2] Apply suggestions from code review --- packages/aws-cdk-lib/aws-apigateway/lib/authorizers/lambda.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/aws-cdk-lib/aws-apigateway/lib/authorizers/lambda.ts b/packages/aws-cdk-lib/aws-apigateway/lib/authorizers/lambda.ts index b9bd100af0acb..df124eb306291 100644 --- a/packages/aws-cdk-lib/aws-apigateway/lib/authorizers/lambda.ts +++ b/packages/aws-cdk-lib/aws-apigateway/lib/authorizers/lambda.ts @@ -132,7 +132,7 @@ abstract class LambdaAuthorizer extends Authorizer implements IAuthorizer { /** * Add Default Permission Role for handler */ - private addDefaultPermissionRole() :void { + private addDefaultPermissionRole(): void { this.handler.addPermission(`${Names.uniqueId(this)}:Permissions`, { principal: new iam.ServicePrincipal('apigateway.amazonaws.com'), sourceArn: this.authorizerArn, @@ -142,7 +142,7 @@ abstract class LambdaAuthorizer extends Authorizer implements IAuthorizer { /** * Add Lambda Invoke Permission for Lambda Authorizer's role */ - private addLambdaInvokePermission(role: iam.Role) :void { + private addLambdaInvokePermission(role: iam.Role): void { role.attachInlinePolicy(new iam.Policy(this, 'authorizerInvokePolicy', { statements: [ new iam.PolicyStatement({