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

feat(parser): add support for API Gateway Lambda authorizer events #4718

Conversation

leandrodamascena
Copy link
Contributor

Issue number: #4536

Summary

Changes

This PR adds support for 3 new Models:

  • Add ApiGatewayAuthorizerRequest for Lambda Authorizer Request type in API Gateway v1 (REST)
  • Add ApiGatewayAuthorizerToken for Lambda Authorizer Token type in API Gateway v1 (REST)
  • Add ApiGatewayAuthorizerRequestV2 for Lambda Authorizer in API Gateway v2 (HTTP)

User experience

from aws_lambda_powertools.utilities.parser import event_parser
from aws_lambda_powertools.utilities.parser.models import ApiGatewayAuthorizerToken

@event_parser
def lambda_handler(event: ApiGatewayAuthorizerToken, context):
  ...

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

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

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@leandrodamascena leandrodamascena requested a review from a team as a code owner July 9, 2024 14:04
@boring-cyborg boring-cyborg bot added documentation Improvements or additions to documentation tests labels Jul 9, 2024
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 9, 2024
@github-actions github-actions bot added feature New feature or functionality and removed documentation Improvements or additions to documentation labels Jul 9, 2024
@boring-cyborg boring-cyborg bot added the documentation Improvements or additions to documentation label Jul 9, 2024
@leandrodamascena leandrodamascena linked an issue Jul 9, 2024 that may be closed by this pull request
2 tasks
@github-actions github-actions bot removed the documentation Improvements or additions to documentation label Jul 9, 2024
@leandrodamascena leandrodamascena requested a review from sthulb July 9, 2024 14:08
Copy link

codecov bot commented Jul 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.42%. Comparing base (ca423a6) to head (3f21e79).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4718   +/-   ##
========================================
  Coverage    96.42%   96.42%           
========================================
  Files          223      223           
  Lines        10744    10755   +11     
  Branches      2001     2001           
========================================
+ Hits         10360    10371   +11     
  Misses         270      270           
  Partials       114      114           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@dreamorosi dreamorosi left a comment

Choose a reason for hiding this comment

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

LGTM!

@leandrodamascena leandrodamascena merged commit 955e385 into aws-powertools:develop Jul 9, 2024
17 checks passed
@leandrodamascena leandrodamascena deleted the feat/parser-apigw-authorizer branch July 9, 2024 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or functionality 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.

Feature request: provide Parser models for Lambda Authorizer
2 participants