-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Adds more tests to investigate #797 * Update deserializer.rs
- Loading branch information
Showing
3 changed files
with
189 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
lambda-events/src/fixtures/example-apigw-sam-http-request.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"body": "", | ||
"cookies": [], | ||
"headers": { | ||
"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.7", | ||
"Accept-Encoding": "gzip, deflate, br", | ||
"Accept-Language": "en-GB,en-US;q=0.9,en;q=0.8", | ||
"Cache-Control": "no-cache", | ||
"Connection": "keep-alive", | ||
"Host": "127.0.0.1:3000", | ||
"Pragma": "no-cache", | ||
"Sec-Ch-Ua": "\"Not_A Brand\";v=\"8\", \"Chromium\";v=\"120\", \"Google Chrome\";v=\"120\"", | ||
"Sec-Ch-Ua-Mobile": "?0", | ||
"Sec-Ch-Ua-Platform": "\"macOS\"", | ||
"Sec-Fetch-Dest": "document", | ||
"Sec-Fetch-Mode": "navigate", | ||
"Sec-Fetch-Site": "none", | ||
"Sec-Fetch-User": "?1", | ||
"Upgrade-Insecure-Requests": "1", | ||
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36", | ||
"X-Forwarded-Port": "3000", | ||
"X-Forwarded-Proto": "http" | ||
}, | ||
"isBase64Encoded": false, | ||
"pathParameters": {}, | ||
"queryStringParameters": { | ||
"foo": "bar" | ||
}, | ||
"rawPath": "/dump", | ||
"rawQueryString": "foo=bar", | ||
"requestContext": { | ||
"accountId": "123456789012", | ||
"apiId": "1234567890", | ||
"domainName": "localhost", | ||
"domainPrefix": "localhost", | ||
"http": { | ||
"method": "GET", | ||
"path": "/dump", | ||
"protocol": "HTTP/1.1", | ||
"sourceIp": "127.0.0.1", | ||
"userAgent": "Custom User Agent String" | ||
}, | ||
"requestId": "b3ea2f1a-9f2a-48a4-8791-0db24e5d40e5", | ||
"routeKey": "GET /dump", | ||
"stage": "$default", | ||
"time": "28/Jan/2024:12:09:08 +0000", | ||
"timeEpoch": 1706443748 | ||
}, | ||
"routeKey": "GET /dump", | ||
"stageVariables": null, | ||
"version": "2.0" | ||
} |
111 changes: 111 additions & 0 deletions
111
lambda-events/src/fixtures/example-apigw-sam-rest-request.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
{ | ||
"body": null, | ||
"headers": { | ||
"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.7", | ||
"Accept-Encoding": "gzip, deflate, br", | ||
"Accept-Language": "en-GB,en-US;q=0.9,en;q=0.8", | ||
"Cache-Control": "max-age=0", | ||
"Connection": "keep-alive", | ||
"Host": "127.0.0.1:3000", | ||
"Sec-Ch-Ua": "\"Not_A Brand\";v=\"8\", \"Chromium\";v=\"120\", \"Google Chrome\";v=\"120\"", | ||
"Sec-Ch-Ua-Mobile": "?0", | ||
"Sec-Ch-Ua-Platform": "\"macOS\"", | ||
"Sec-Fetch-Dest": "document", | ||
"Sec-Fetch-Mode": "navigate", | ||
"Sec-Fetch-Site": "none", | ||
"Sec-Fetch-User": "?1", | ||
"Upgrade-Insecure-Requests": "1", | ||
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36", | ||
"X-Forwarded-Port": "3000", | ||
"X-Forwarded-Proto": "http" | ||
}, | ||
"httpMethod": "GET", | ||
"isBase64Encoded": false, | ||
"multiValueHeaders": { | ||
"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.7" | ||
], | ||
"Accept-Encoding": [ | ||
"gzip, deflate, br" | ||
], | ||
"Accept-Language": [ | ||
"en-GB,en-US;q=0.9,en;q=0.8" | ||
], | ||
"Cache-Control": [ | ||
"max-age=0" | ||
], | ||
"Connection": [ | ||
"keep-alive" | ||
], | ||
"Host": [ | ||
"127.0.0.1:3000" | ||
], | ||
"Sec-Ch-Ua": [ | ||
"\"Not_A Brand\";v=\"8\", \"Chromium\";v=\"120\", \"Google Chrome\";v=\"120\"" | ||
], | ||
"Sec-Ch-Ua-Mobile": [ | ||
"?0" | ||
], | ||
"Sec-Ch-Ua-Platform": [ | ||
"\"macOS\"" | ||
], | ||
"Sec-Fetch-Dest": [ | ||
"document" | ||
], | ||
"Sec-Fetch-Mode": [ | ||
"navigate" | ||
], | ||
"Sec-Fetch-Site": [ | ||
"none" | ||
], | ||
"Sec-Fetch-User": [ | ||
"?1" | ||
], | ||
"Upgrade-Insecure-Requests": [ | ||
"1" | ||
], | ||
"User-Agent": [ | ||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" | ||
], | ||
"X-Forwarded-Port": [ | ||
"3000" | ||
], | ||
"X-Forwarded-Proto": [ | ||
"http" | ||
] | ||
}, | ||
"multiValueQueryStringParameters": null, | ||
"path": "/test", | ||
"pathParameters": null, | ||
"queryStringParameters": null, | ||
"requestContext": { | ||
"accountId": "123456789012", | ||
"apiId": "1234567890", | ||
"domainName": "127.0.0.1:3000", | ||
"extendedRequestId": null, | ||
"httpMethod": "GET", | ||
"identity": { | ||
"accountId": null, | ||
"apiKey": null, | ||
"caller": null, | ||
"cognitoAuthenticationProvider": null, | ||
"cognitoAuthenticationType": null, | ||
"cognitoIdentityPoolId": null, | ||
"sourceIp": "127.0.0.1", | ||
"user": null, | ||
"userAgent": "Custom User Agent String", | ||
"userArn": null | ||
}, | ||
"path": "/test", | ||
"protocol": "HTTP/1.1", | ||
"requestId": "ea86b9eb-c688-4bbb-8309-a1671442bea9", | ||
"requestTime": "28/Jan/2024:11:05:46 +0000", | ||
"requestTimeEpoch": 1706439946, | ||
"resourceId": "123456", | ||
"resourcePath": "/test", | ||
"stage": "Prod" | ||
}, | ||
"resource": "/test", | ||
"stageVariables": null, | ||
"version": "1.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters