-
Notifications
You must be signed in to change notification settings - Fork 453
refactor(parser): Improve AppSync models with examples and descriptions #7330
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
refactor(parser): Improve AppSync models with examples and descriptions #7330
Conversation
Enhances the AppSync parser models with field descriptions and examples using Pydantic's Field() functionality. This improvement provides better documentation and metadata for AppSync event parsing, following the pattern established in previous PRs. All field descriptions are based on official AWS AppSync documentation and include realistic examples from actual test events. Closes aws-powertools#7122
- Sanitize JWT token examples to use generic placeholders - Remove authorization header from examples to avoid hardcoded credentials - Replace sensitive UUIDs with generic placeholders - Address SonarQube security hotspots while maintaining example clarity
…spots - Remove token_use and auth_time fields from JWT claims examples - Sanitize OIDC subject identifier examples - Address remaining SonarCloud security concerns while maintaining example clarity
…hotspots - Simplify JWT claims examples to minimal required fields - Remove complex nested authentication data - Keep examples clear but security-compliant - Final resolution of SonarCloud security concerns
…tspots - Remove JWT claims examples that trigger security hotspots - Keep comprehensive field descriptions for developer guidance - Maintain functionality while ensuring security compliance - Final resolution of all SonarCloud security concerns
- Replace all hardcoded IP addresses with localhost and private network examples - Use 127.0.0.1 and 10.0.0.x addresses to avoid SonarCloud security hotspots - Addresses SonarCloud security concerns about hardcoded IP addresses - Final resolution of all security hotspots
…tspots - Remove all IP address examples from sourceIp fields and headers - Keep comprehensive field descriptions for developer guidance - Maintain functionality while ensuring complete security compliance - Final resolution of all SonarCloud security hotspots
- Format appsync.py file according to project standards using Ruff - Fix 13 additional linting issues automatically - Ensure all 1167 files pass formatting checks - Resolves GitHub Actions workflow failure in PR aws-powertools#7330
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.
@dcabib thanks for working on this. I left some feedback and please run make format
to fix the problems.
aws_lambda_powertools/utilities/parser/models/appsync_events.py
Outdated
Show resolved
Hide resolved
aws_lambda_powertools/utilities/parser/models/appsync_events.py
Outdated
Show resolved
Hide resolved
aws_lambda_powertools/utilities/parser/models/appsync_events.py
Outdated
Show resolved
Hide resolved
aws_lambda_powertools/utilities/parser/models/appsync_events.py
Outdated
Show resolved
Hide resolved
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #7330 +/- ##
========================================
Coverage 96.36% 96.36%
========================================
Files 275 275
Lines 13007 13007
Branches 968 968
========================================
Hits 12534 12534
Misses 366 366
Partials 107 107 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3014dc6
into
aws-powertools:develop
Issue number: #7122
Summary
Enhances the AppSync parser models with field descriptions and examples using Pydantic's Field() functionality. This improvement provides better documentation and metadata for AppSync event parsing, following the pattern established in previous PRs.
Changes
Added Field() descriptions and examples to all AppSync parser model classes:
All field descriptions are based on official AWS AppSync documentation
Examples sourced from actual test events and AWS documentation
Maintains 100% backward compatibility - no breaking changes to type annotations or validation logic
Follows best practices from successful PRs (default=None pattern for Optional fields)
User experience
Customers will be able to see examples and descriptions when using AppSync parser models, providing:
Checklist
Is this a breaking change? No
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.
Closes #7122