Skip to content

Add support for multi-value parameters in API Gateway proxy events #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 4, 2018
Merged

Add support for multi-value parameters in API Gateway proxy events #136

merged 3 commits into from
Dec 4, 2018

Conversation

piotrkubisa
Copy link
Contributor

@piotrkubisa piotrkubisa commented Oct 24, 2018

Recently I was digging more into Lambda environment and I found new fields which are not defined in aws-lambda-go struct for API Gateway Proxy Request event:

  • events.APIGatewayProxyRequest.MultiValueHeaders.
  • events.APIGatewayProxyRequest.MultiValueQueryStringParameters.
  • events.APIGatewayRequestIdentity.AccessKey (populated whether doing an authorization using AWS credentials).

https://aws.amazon.com/about-aws/whats-new/2018/10/amazon-api-gateway-adds-support-for-multi-parameters/

Maintainers: do we need any extra unit test for these new fields?

* Add multiValueHeaders
* Add multiValueQueryStringParameters
* Add requestContext.identity.accessKey
@codecov-io
Copy link

codecov-io commented Oct 24, 2018

Codecov Report

Merging #136 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #136   +/-   ##
=======================================
  Coverage   69.65%   69.65%           
=======================================
  Files          17       17           
  Lines         715      715           
=======================================
  Hits          498      498           
  Misses        173      173           
  Partials       44       44

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fb8f88d...5d277fe. Read the comment docs.

@piotrkubisa piotrkubisa changed the title Add extra fields to APIGatewayProxyRequest Add support for multi-value parameters for API Gateway proxy events Oct 24, 2018
@piotrkubisa piotrkubisa changed the title Add support for multi-value parameters for API Gateway proxy events Add support for multi-value parameters in API Gateway proxy events Oct 24, 2018
@piotrkubisa
Copy link
Contributor Author

piotrkubisa commented Nov 14, 2018

Yesterday I found also a blog post about multi-value parameters on the AWS Compute Blog https://aws.amazon.com/blogs/compute/support-for-multi-value-parameters-in-amazon-api-gateway/

Is there anything what I can do in this PR to help you introduce this change to the aws-lambda-go repository?

@harrisonhjones
Copy link
Contributor

I haven't dove too deeply into the testing of this package but it seems like you did change some test data json files. If you updated the tests that relied on those files to check for the new properties (events.APIGatewayProxyRequest.MultiValueHeaders, events.APIGatewayProxyRequest.MultiValueQueryStringParameters, &
events.APIGatewayRequestIdentity.AccessKey) and their correct values that would be sufficient.

@@ -42,7 +66,8 @@
"accountId": "theAccountId",
"cognitoIdentityId": "theCognitoIdentityId",
"caller": "theCaller",
"apiKey": "theApiKey",
"apiKey": "theApiKey",
"accessKey": "ANEXAMPLEOFACCESSKEY",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for adding this as well

@bmoffatt
Copy link
Collaborator

bmoffatt commented Dec 4, 2018

LGTM, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants