Skip to content
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

fix: add user dependency to webhook endpoint for flow execution #3685

Merged
merged 2 commits into from
Sep 4, 2024

Conversation

ogabrielluiz
Copy link
Contributor

This pull request adds a user parameter to the webhook_run_flow endpoint in endpoints.py. It also introduces a new helper function, get_user_by_flow_id_or_endpoint_name, in user.py to retrieve user details based on flow ID or endpoint name. These changes allow for API key association with the user when running a flow through the webhook endpoint.

Fixes #3407

…ser.py

- Introduced `get_user_by_flow_id_or_endpoint_name` function to fetch user details based on flow ID or endpoint name.
- Added error handling for cases where the flow or user is not found.
- Utilized `get_db_service` for database session management.
- Import `get_user_by_flow_id_or_endpoint_name` helper function.
- Add `user` parameter to `webhook_run_flow` endpoint.
- Pass `user` to `simple_run_flow_task` for API key association.
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels Sep 4, 2024
@github-actions github-actions bot added bug Something isn't working and removed enhancement New feature or request labels Sep 4, 2024
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-3685.dmtpw4p5recq1.amplifyapp.com

Copy link
Contributor

@anovazzi1 anovazzi1 left a comment

Choose a reason for hiding this comment

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

lgtm

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 4, 2024
@ogabrielluiz ogabrielluiz merged commit 46a66a5 into main Sep 4, 2024
43 of 45 checks passed
@ogabrielluiz ogabrielluiz deleted the fix/webhookglobalvars branch September 4, 2024 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flow works in Playground but fails when called from Webhook
2 participants