Repository navigation
Conversation
Refactor form app/site resolution logic to a new function and update related calls.
Added Forbidden exception handling for upload token validation.
Refactor unit tests for human input form endpoints to use database session and improve readability.
Added tests for form app checks and token validation during file uploads.
Contributor
Pyrefly Type Coverage
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #44449 +/- ##
=======================================
Coverage 88.80% 88.80%
=======================================
Files 5558 5558
Lines 332910 332925 +15
Branches 66661 66662 +1
=======================================
+ Hits 295644 295661 +17
+ Misses 32088 32087 -1
+ Partials 5178 5177 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
6 tasks done
Contributor
Author
|
All checks pass. Could you take a look when you get a chance? The Human Input form page already checks the form's app before it shows the form. This PR runs the same check on the form submit, the upload-token endpoint, and the file upload. These requests are now blocked when the workspace is archived, the site is missing, or the app is deleted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #44447
Summary
The web form page checks the form's app before it shows the form. The submit, the upload-token endpoint, and the file upload did not run this check. This PR shares the check with all three endpoints, in the same order as the form page.
invalid_upload_tokenerror.This PR touches the same file as #39661. The two changes do not overlap in logic.
Checklist
make lint && make type-check(backend) andvp staged(frontend) to appease the lint gods