-
Notifications
You must be signed in to change notification settings - Fork 23
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
Webhook handlers as FastAPI APIRoutes to allow for Depends injection,… #13
Webhook handlers as FastAPI APIRoutes to allow for Depends injection,… #13
Conversation
… refactor - update deps - remove the need for the framework to have the apps Settings - deatach Manifest from settings - deatach development http/https handling from the debug setting (for unambiguity) - create APIRoutes for every webhook handler - introduce the Simple Saleor Client (potentially will land in a separate package in the future) - add url_for resololution in Manifest URLs - describe different verions of webhook payloads (with meta)
- add SQS targetUrl handling on installation - add the ability to not provide any handlers - stop using FastAPI app.extra - add lazy url loading on manifest definition - hide potentially sensitive logs to debug level - add dynamic webhook handler model definition (for easier maintenence) - add EXPERIMENTAL SQS worker (untested)
8ccf9e1
to
129e638
Compare
|
||
# app.dependency_overrides[verify_saleor_domain] = lambda: True |
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.
Should be removed, right?
…pos and review coments
samples/complex_app/app.py
Outdated
@@ -39,7 +39,7 @@ async def get_webhook_details(domain_name: DomainName) -> WebhookData: | |||
app = SaleorApp( | |||
validate_domain=validate_domain, | |||
save_app_data=store_app_data, | |||
webhook_handlers=webhook_handlers, | |||
http_webhook_handlers=webhook_handlers, |
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.
It is not needed anymore, right?
samples/complex_app/webhooks.py
Outdated
@@ -17,7 +17,7 @@ async def product_deleted(payload: Payload, saleor_domain: DomainName): | |||
print(payload) | |||
|
|||
|
|||
webhook_handlers = WebhookHandlers( | |||
http_webhook_handlers = WebhookHandlers( |
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.
I believe, everything with WebhookHandlers can be removed, right?
"Unable to finish installation of app for %s. Received error: %s", | ||
domain, | ||
webhook_error, | ||
logger.error("Unable to finish installation of app for %s.", saleor_domain) |
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.
We should figure out how to treat an installation when some of the requests will pass successfully and the rest fail. But I don't think this is a scope of this PR, I just raise it to keep in mind
… refactor
Add experimental SQS support, imporved resiency, add test coverage