APIGateway V2: add authorizerPayloadFormatVersion to the authorizer (#5144)

This commit is contained in:
Cesar Alvernaz 2022-05-19 12:07:26 +01:00 committed by GitHub
parent 416bef76e6
commit ea4af2346c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -261,7 +261,9 @@ class ApiGatewayV2Response(BaseResponse):
params = json.loads(self.body)
auth_creds_arn = params.get("authorizerCredentialsArn")
auth_payload_format_version = params.get("authorizerPayloadFormatVersion")
auth_payload_format_version = (
params.get("authorizerPayloadFormatVersion") or "2.0"
)
auth_result_ttl = params.get("authorizerResultTtlInSeconds")
authorizer_type = params.get("authorizerType")
authorizer_uri = params.get("authorizerUri")

View File

@ -51,6 +51,7 @@ def test_create_authorizer():
{"Audience": ["a1"], "Issuer": "moto.com"}
)
resp.should.have.key("Name").equals("auth1")
resp.should.have.key("AuthorizerPayloadFormatVersion").equals("2.0")
@mock_apigatewayv2
@ -67,6 +68,7 @@ def test_get_authorizer():
resp.should.have.key("AuthorizerId")
resp.should.have.key("AuthorizerType").equals("REQUEST")
resp.should.have.key("Name").equals("auth1")
resp.should.have.key("AuthorizerPayloadFormatVersion").equals("2.0")
@mock_apigatewayv2