Skip to content

Conversation

dcabib
Copy link
Contributor

@dcabib dcabib commented Sep 5, 2025

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:

      • IAM authentication with AWS account details and identity provider information
      • Cognito User Pool authentication with JWT claims and group membership
      • OpenID Connect provider authentication with claims and issuer details
      • Lambda authorizer custom context functionality
      • HTTP request context including headers and custom domains
      • GraphQL query details with selection sets, variables, and field information
      • Pipeline resolver previous operation results
      • Complete resolver event with all context fields
      • Channel path and segments information
      • Channel namespace details
      • Complete channel operation information
      • Individual event with ID and payload details
      • Complete events operation context with error handling
  • 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:

  • Rich IntelliSense with field descriptions and realistic examples
  • Self-documenting code without needing external AWS documentation
  • Professional API documentation via .model_json_schema()
  • Faster development with immediate reference for acceptable values
  • Clear understanding of different authentication types and event structures

Checklist

  • ✅ Meet tenets criteria
  • ✅ I have performed a self-review of this change
  • ✅ Changes have been tested (all existing tests pass)
  • ✅ Changes are documented (via Field descriptions)
  • ✅ PR title follows conventional commit semantics

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

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
@dcabib dcabib requested a review from a team as a code owner September 5, 2025 11:17
@dcabib dcabib requested a review from hjgraca September 5, 2025 11:17
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 5, 2025
- 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
Copy link

sonarqubecloud bot commented Sep 5, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tech debt: Improve documentation of Event model fields in AppSync parser models
1 participant