Skip to content

Tech debt: Centralize DictWrapper functions for query, header, json_data, etc. #2424

Closed

Description

@heitorlessa

Why is this needed?

API Gateway (REST, HTTP), ALB, Lambda Function URL, and VPC Lattice unfortunately have differences in the payload. This leads to having nearly the same functionality in Event Source Data Classes to work around these differences and limitations.

These will eventually lead to a drift in implementation, making it harder to debug.

Latest example: https://github.com/awslabs/aws-lambda-powertools-python/pull/2358/files#diff-209f210ae09d053ce73d291e9f7b3869015b7f592f186be386518f152aa497adR56

Which area does this relate to?

Event Source Data Classes

Suggestion

Within aws_lambda_powertools/utilities/data_classes/common.py, we could have standalone functions like get_header_value, and create new ones to handle JSON and Base64 deserialization.

This means updating code in several places where we might have HTTP Headers, HTTP Query Strings, HTTP JSON payload, Base64 payload -- SNS, SQS, Kinesis, API Gateway, AppSync, etc.

Acknowledgment

Activity

  1. added
    triage
    tech-debt
    event_sources
    and removed
    triage
    on Jun 8, 2023
  2. added
    pending-release
    on Jun 20, 2023
  3. github-actions commented on Jun 20, 2023

    @github-actions
    Contributor

    ⚠️COMMENT VISIBILITY WARNING⚠️

    This issue is now closed. Please be mindful that future comments are hard for our team to see.

    If you need more assistance, please either tag a team member or open a new issue that references this one.

    If you wish to keep having a conversation with other community members under this issue feel free to do so.

  4. moved this from Working on it to Coming soon in Powertools for AWS Lambda (Python)on Jun 20, 2023
  5. github-actions commented on Jun 23, 2023

    @github-actions
    Contributor

    This is now released under 2.18.0 version!

  6. removed
    pending-release
    on Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    event_sourcestech-debt

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions