Skip to content

Commit 8bd1e37

Browse files
authored
🤖 Merge PR DefinitelyTyped#71900 [serverless] - fix(serverless): add custom authorizers to httpApi provider definitions by @groteworld
1 parent 0f3e3a0 commit 8bd1e37

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

‎types/serverless/plugins/aws/provider/awsProvider.d.ts‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,20 @@ declare namespace Aws {
189189
audience: string[];
190190
}
191191

192+
interface CustomAuthorizer {
193+
type: "request";
194+
functionName?: string;
195+
functionArn?: string;
196+
name?: string;
197+
resultTtlInSeconds?: number;
198+
enableSimpleResponses?: boolean;
199+
payloadVersion?: string;
200+
identitySource?: string[];
201+
managedExternally?: boolean;
202+
}
203+
192204
interface Authorizers {
193-
[key: string]: CognitoAuthorizer | OidcAuthorizer | JwtAuthorizer;
205+
[key: string]: CognitoAuthorizer | OidcAuthorizer | JwtAuthorizer | CustomAuthorizer;
194206
}
195207

196208
interface Alb {

‎types/serverless/serverless-tests.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,10 @@ const awsServerless: Aws.Serverless = {
392392
issuerUrl: "testissuerUrl",
393393
audience: ["testaudience"],
394394
},
395+
testCustomAuthorizer: {
396+
type: "request",
397+
functionName: "testCustomAuthorizer"
398+
}
395399
},
396400
useProviderTags: true,
397401
metrics: true,
@@ -953,6 +957,9 @@ const awsServerless: Aws.Serverless = {
953957
authorizer: "aws_iam",
954958
},
955959
},
960+
testCustomAuthorizer: {
961+
handler: "testauthorizer",
962+
}
956963
},
957964
layers: {
958965
testLayer: {

0 commit comments

Comments
 (0)