I am using localstack. If no authorization (authorizationType = NONE) is configured for the lambda proxy integration with API gateway, the authorizer
field is omitted in the lambda event body.
Error: data did not match any variant of untagged enum LambdaRequest
{
"path": "/",
"headers": {
"remote-addr": "172.17.0.1",
"host": "localhost:4566",
"connection": "keep-alive",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36",
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
"sec-gpc": "1",
"sec-fetch-site": "none",
"sec-fetch-mode": "navigate",
"sec-fetch-user": "?1",
"sec-fetch-dest": "document",
"accept-encoding": "gzip, deflate, br",
"accept-language": "en-US,en;q=0.9",
"x-forwarded-for": "172.17.0.1, localhost:4566, 127.0.0.1, localhost:4566",
"x-localstack-edge": "http://localhost:4566",
"authorization": "AWS4-HMAC-SHA256 Credential=__internal_call__/20160623/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=1234",
"x-localstack-tgt-api": "apigateway",
"__apigw_request_region__": "us-east-1"
},
"multiValueHeaders": {
"remote-addr": ["172.17.0.1"],
"host": ["localhost:4566"],
"connection": ["keep-alive"],
"upgrade-insecure-requests": ["1"],
"user-agent": [
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36"
],
"accept": [
"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
],
"sec-gpc": ["1"],
"sec-fetch-site": ["none"],
"sec-fetch-mode": ["navigate"],
"sec-fetch-user": ["?1"],
"sec-fetch-dest": ["document"],
"accept-encoding": ["gzip, deflate, br"],
"accept-language": ["en-US,en;q=0.9"],
"x-forwarded-for": [
"172.17.0.1, localhost:4566, 127.0.0.1, localhost:4566"
],
"x-localstack-edge": ["http://localhost:4566"],
"authorization": [
"AWS4-HMAC-SHA256 Credential=__internal_call__/20160623/us-east-1/apigateway/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=1234"
],
"x-localstack-tgt-api": ["apigateway"],
"__apigw_request_region__": ["us-east-1"]
},
"body": "",
"isBase64Encoded": false,
"httpMethod": "GET",
"queryStringParameters": {},
"multiValueQueryStringParameters": {},
"pathParameters": {},
"resource": "/",
"requestContext": {
"path": "/prod/",
"resourcePath": "/",
"apiId": "qw9nx3npwz",
"domainPrefix": "qw9nx3npwz",
"domainName": "qw9nx3npwz.execute-api.localhost.localstack.cloud",
"accountId": "000000000000",
"resourceId": "9htszz4dh3",
"stage": "prod",
"identity": {
"accountId": "000000000000",
"sourceIp": "127.0.0.1",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36"
},
"httpMethod": "GET",
"protocol": "HTTP/1.1",
"requestTime": "2021-11-01T15:45:14.341Z",
"requestTimeEpoch": 1635781514341
},
"stageVariables": {}
}