-
Notifications
You must be signed in to change notification settings - Fork 436
feat(parser): Added Cognito trigger schemas #6737
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): Added Cognito trigger schemas #6737
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @VatsalGoel3 can you pls run make format
and push a commit again? Ruff is complaining about some files.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #6737 +/- ##
===========================================
+ Coverage 96.20% 96.25% +0.04%
===========================================
Files 273 274 +1
Lines 12713 12856 +143
Branches 950 950
===========================================
+ Hits 12231 12374 +143
Misses 377 377
Partials 105 105 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @VatsalGoel3 thanks a lot for working in this PR! I had to make some changes to align with the TypeScript implementation: https://github.com/aws-powertools/powertools-lambda-typescript/blob/main/packages/parser/src/schemas/cognito.ts
@dreamorosi can you pls review this?
Issue number: #6203
Summary
Changes
This PR adds full support for all Amazon Cognito User Pool Lambda Triggers as part of the Parser (Pydantic) utility. These include schemas for:
Each schema includes:
__init__.py
User experience
Before:
@parser
for Cognito triggers.After:
@parser(model=CognitoXxxEventModel)
.Checklist
Is this a breaking change?
RFC issue number: N/A
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Some schemas are currently failing validation in tests due to discrepancies in the sample fixture files:
email_verified
,phone_number_verified
appear asbool
in test events but the schema expectsstr
awsSdk
vsawsSdkVersion
cause mismatchesWould you prefer:
bool | str
, with appropriate aliases?