feat(parser): Added Cognito trigger schemas#6737
feat(parser): Added Cognito trigger schemas#6737leandrodamascena merged 11 commits intoaws-powertools:developfrom
Conversation
leandrodamascena
left a comment
There was a problem hiding this comment.
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:
|
|
leandrodamascena
left a comment
There was a problem hiding this comment.
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__.pyUser experience
Before:
@parserfor 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_verifiedappear asboolin test events but the schema expectsstrawsSdkvsawsSdkVersioncause mismatchesWould you prefer:
bool | str, with appropriate aliases?