Skip to content

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

Merged
leandrodamascena merged 2 commits into
aws-powertools:developfrom
leandrodamascena:feat/parser-apigw-authorizer
Jul 9, 2024
Merged

feat(parser): add support for API Gateway Lambda authorizer events#4718
leandrodamascena merged 2 commits into
aws-powertools:developfrom
leandrodamascena:feat/parser-apigw-authorizer

Conversation

@leandrodamascena

Copy link
Copy Markdown
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 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
@codecov

codecov Bot commented Jul 9, 2024

Copy link
Copy Markdown

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.

@dreamorosi dreamorosi left a comment

Copy link
Copy Markdown
Contributor

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
@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