mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 14:20:12 +00:00
[aws-lambda]: Fix definition of APIGatewayRequestAuthorizerEvent (#43539)
* [aws-lambda]: Fix APIGatewayRequestAuthorizerEvent definition * [aws-lambda]: Update tests for updated APIGatewayRequestAuthorizerEvent definition
This commit is contained in:
@@ -201,7 +201,6 @@ const authorizer: APIGatewayAuthorizerHandler = async (event, context, callback)
|
||||
str = event.resource; // $ExpectError
|
||||
} else {
|
||||
event.type; // $ExpectType "REQUEST"
|
||||
str = event.methodArn; // $ExpectError
|
||||
str = event.resource;
|
||||
}
|
||||
|
||||
@@ -221,7 +220,6 @@ const authorizerWithCustomContext: APIGatewayAuthorizerWithContextHandler<Custom
|
||||
str = event.resource; // $ExpectError
|
||||
} else {
|
||||
event.type; // $ExpectType "REQUEST"
|
||||
str = event.methodArn; // $ExpectError
|
||||
str = event.resource;
|
||||
}
|
||||
|
||||
@@ -273,7 +271,7 @@ const requestAuthorizer: APIGatewayRequestAuthorizerHandler = async (event, cont
|
||||
event.type; // $ExpectType "REQUEST"
|
||||
|
||||
str = event.type;
|
||||
str = event.methodArn; // $ExpectError
|
||||
str = event.methodArn;
|
||||
str = event.authorizationToken; // $ExpectError
|
||||
str = event.resource;
|
||||
str = event.path;
|
||||
@@ -291,8 +289,10 @@ const requestAuthorizer: APIGatewayRequestAuthorizerHandler = async (event, cont
|
||||
if (event.stageVariables !== null)
|
||||
str = event.stageVariables[str];
|
||||
const requestContext: APIGatewayEventRequestContext = event.requestContext;
|
||||
str = event.domainName;
|
||||
str = event.apiId;
|
||||
if (requestContext.domainName != null) {
|
||||
str = requestContext.domainName;
|
||||
}
|
||||
str = requestContext.apiId;
|
||||
|
||||
const result = createAuthorizerResult();
|
||||
|
||||
@@ -305,7 +305,7 @@ const requestAuthorizerWithCustomContext: APIGatewayRequestAuthorizerWithContext
|
||||
event.type; // $ExpectType "REQUEST"
|
||||
|
||||
str = event.type;
|
||||
str = event.methodArn; // $ExpectError
|
||||
str = event.methodArn;
|
||||
str = event.authorizationToken; // $ExpectError
|
||||
|
||||
const result = createAuthorizerResultWithCustomContext();
|
||||
|
||||
@@ -34,8 +34,11 @@ export interface APIGatewayTokenAuthorizerEvent {
|
||||
// Note, when invoked by the tester in the AWS web console, the map values can be null,
|
||||
// but they will be empty objects in the real object.
|
||||
// Worse, it will include "body" and "isBase64Encoded" properties, unlike the real call!
|
||||
// See https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-lambda-authorizer-input.html for the
|
||||
// formal definition.
|
||||
export interface APIGatewayRequestAuthorizerEvent {
|
||||
type: "REQUEST";
|
||||
methodArn: string;
|
||||
resource: string;
|
||||
path: string;
|
||||
httpMethod: string;
|
||||
@@ -46,8 +49,6 @@ export interface APIGatewayRequestAuthorizerEvent {
|
||||
multiValueQueryStringParameters: { [name: string]: string[] } | null;
|
||||
stageVariables: { [name: string]: string } | null;
|
||||
requestContext: APIGatewayEventRequestContextWithAuthorizer<undefined>;
|
||||
domainName: string;
|
||||
apiId: string;
|
||||
}
|
||||
|
||||
export interface APIGatewayAuthorizerResult {
|
||||
|
||||
Reference in New Issue
Block a user