Skip to content

Feature: Handle V2 Event#1182

Closed
rehanhwr wants to merge 31 commits intozappa:masterfrom
rehanhwr:handler-for-v2.0-formatted-event
Closed

Feature: Handle V2 Event#1182
rehanhwr wants to merge 31 commits intozappa:masterfrom
rehanhwr:handler-for-v2.0-formatted-event

Conversation

@rehanhwr
Copy link
Copy Markdown
Contributor

Description

Handle v2 formatted event coming from HTTP API Gateway or Lambda Function URL.

GitHub Issues

#1121
#851

@sridhar562345
Copy link
Copy Markdown
Contributor

@rehanhwr Did you verify the request format when custom stage is added on http api instead of $default?

@rehanhwr
Copy link
Copy Markdown
Contributor Author

@rehanhwr Did you verify the request format when custom stage is added on http api instead of $default?

@sridhar562345 the format is the same, however the path value in the event is different because it'll include stage name as prefix. this could be solved by setting the base_path in the zappa settings to strip out the prefix from the path

Copy link
Copy Markdown
Collaborator

@monkut monkut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A quick look and some brief comments to start this moving forward.

Comment thread zappa/handler.py Outdated
Comment thread zappa/handler.py Outdated
Comment thread zappa/handler.py Outdated
Comment thread zappa/handler.py Outdated
Comment thread zappa/wsgi.py Outdated
@rehanhwr rehanhwr requested a review from monkut October 20, 2022 03:44
@coveralls
Copy link
Copy Markdown

coveralls commented Oct 22, 2022

Coverage Status

Coverage decreased (-0.09%) to 74.456% when pulling ec823b5 on rehanhwr:handler-for-v2.0-formatted-event into 73ee393 on zappa:master.

Copy link
Copy Markdown
Collaborator

@monkut monkut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still need some more time to take a look at this, but I've commented a bit more.

Comment thread zappa/handler.py
Comment thread zappa/wsgi.py Outdated
@rehanhwr rehanhwr force-pushed the handler-for-v2.0-formatted-event branch 2 times, most recently from ad52097 to a000bee Compare October 22, 2022 16:41
@rehanhwr rehanhwr force-pushed the handler-for-v2.0-formatted-event branch from 2c5e697 to 69f3b71 Compare October 22, 2022 17:15
@rehanhwr
Copy link
Copy Markdown
Contributor Author

@rehanhwr Can you run make black / make isort on this?

will update it soon

@rehanhwr rehanhwr requested a review from monkut November 16, 2022 14:38
Comment thread zappa/wsgi.py Outdated
Comment thread zappa/wsgi.py Outdated
Comment thread zappa/wsgi.py Outdated
Comment thread zappa/wsgi.py Outdated
Comment thread zappa/wsgi.py Outdated
@rehanhwr rehanhwr requested a review from monkut November 29, 2022 15:46
@sridhar562345
Copy link
Copy Markdown
Contributor

@monkut can we merge this in next release?

@harshild
Copy link
Copy Markdown

@monkut @rehanhwr - Do let me know what's left to get this PR through. I can contribute

@justinwride
Copy link
Copy Markdown

I am very interested in this functionality 🙏 Please update what needs to happen for this to be merged.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 3, 2024

Hi there! Unfortunately, this PR has not seen any activity for at least 90 days. If the PR is still relevant to the latest version of Zappa, please comment within the next 10 days if you wish to keep it open. Otherwise, it will be automatically closed.

@github-actions github-actions bot added the no-activity [Bot] Closing soon if no new activity label Apr 3, 2024
@github-actions
Copy link
Copy Markdown

Hi there! Unfortunately, this PR was automatically closed as it had not seen any activity in at least 100 days. If the PR is still relevant to the latest version of Zappa, please open a new PR.

@github-actions github-actions bot added the auto-closed [Bot] Closed, details in comments label Apr 13, 2024
@github-actions github-actions bot closed this Apr 13, 2024
@monkut
Copy link
Copy Markdown
Collaborator

monkut commented May 20, 2025

this got auto-closed reopening

@monkut monkut reopened this May 20, 2025
@github-actions github-actions bot added needs-review Needs attention from a maintainer and removed auto-closed [Bot] Closed, details in comments no-activity [Bot] Closing soon if no new activity labels May 20, 2025
monkut added a commit that referenced this pull request May 20, 2025
* 🔧 migrate #971 to lastest master

* 🎨 run black/isort

* ♻️ refactor to allow for other binary ignore types based on mimetype. (currently openapi schema can't be passed as text.

* 🎨 run black/fix flake8

* 🔧 add EXCEPTION_HANDLER setting

* 🐛 fix zappa_returndict["body"] assignment

* 📝 add temp debug info

* 🔥 delete unnecessary print statements

* ♻️ Update comments and minor refactor for clarity

* ♻️ refactor for ease of testing and clarity

* 🎨 fix flake8

* ✨ add `additional_text_mimetypes` setting
✅ add testcases for additional_text_mimetypes handling

* 🔧 Expand default text mimetypes mentioned in #1023
♻️ define "DEFAULT_TEXT_MIMETYPES" and move to utilities.py

* 🎨 run black/isort

* 🎨 run black/isort

* feat: implement handler for event with format  version 2.0

* refactor: getting processed response body from new method

* fix: lint error

* chore: move variable initialization before initial if condition

* refactor: abstract implementations to two processing methods

* fix: determine payload version based on value in the event itself

* fixed lint

---------

Co-authored-by: monkut <shane.cousins@gmail.com>
Co-authored-by: Rehan Hawari <rehan.hawari10@gmail.com>
@monkut
Copy link
Copy Markdown
Collaborator

monkut commented May 20, 2025

conflicts fixed and handled in PR #1377

closing

@monkut monkut closed this May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review Needs attention from a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants