Skip to content
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

fix(event-sources): Pass authorizer data to APIGatewayEventAuthorizer #897

Merged
merged 2 commits into from
Dec 16, 2021

Conversation

michaelbrewer
Copy link
Contributor

Issue #, if available:

Description of changes:

Changes:

  • contract APIGatewayEventAuthorizer from the authorizer data
  • add test cases for the additional fields that can optional be in the authorizer dict
  • Update DictWrapper to allow for a default in get

Checklist

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Changes:
- contract APIGatewayEventAuthorizer from the authorizer data
- add test cases for the additional fields that can optional be in the authorizer dict
- Update DictWrapper to allow for a default in `get`
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 14, 2021
@codecov-commenter
Copy link

Codecov Report

Merging #897 (58e8f39) into develop (8406c9b) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #897   +/-   ##
========================================
  Coverage    99.88%   99.88%           
========================================
  Files          118      118           
  Lines         5133     5133           
  Branches       573      573           
========================================
  Hits          5127     5127           
  Misses           2        2           
  Partials         4        4           
Impacted Files Coverage Δ
.../utilities/data_classes/api_gateway_proxy_event.py 100.00% <100.00%> (ø)
...lambda_powertools/utilities/data_classes/common.py 100.00% <100.00%> (ø)

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 8406c9b...58e8f39. Read the comment docs.

@@ -56,7 +67,7 @@ def route_key(self) -> Optional[str]:

@property
def authorizer(self) -> APIGatewayEventAuthorizer:
return APIGatewayEventAuthorizer(self._data)
return APIGatewayEventAuthorizer(self._data["requestContext"]["authorizer"])
Copy link
Contributor

Choose a reason for hiding this comment

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

Yes!!!!

@heitorlessa heitorlessa added bug Something isn't working area/event_sources labels Dec 16, 2021
@heitorlessa heitorlessa merged commit e91932c into aws-powertools:develop Dec 16, 2021
heitorlessa added a commit to heitorlessa/aws-lambda-powertools-python that referenced this pull request Dec 17, 2021
…tools-python into feat/batch-new-processor

* 'develop' of https://github.com/awslabs/aws-lambda-powertools-python:
  fix(parser): kinesis sequence number is str, not int (aws-powertools#907)
  feat(apigateway): add exception_handler support (aws-powertools#898)
  fix(event-sources): Pass authorizer data to APIGatewayEventAuthorizer (aws-powertools#897)
  chore(deps): bump fastjsonschema from 2.15.1 to 2.15.2 (aws-powertools#891)
@michaelbrewer michaelbrewer deleted the fix-apgw-authorizer branch December 23, 2021 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants