fix: merging dev to main - #327
Merged
Merged
Conversation
Add verify_process_ownership helper and apply it to all /api/process/* endpoints and the /api/file/upload endpoint so authenticated callers can only access processes they own. Returns 404 (not 403) for missing or non-owned processes to avoid confirming existence. status/render_status previously had no auth at all; both now authenticate and check ownership. Adds ownership-enforcement tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fix: merging main to dev
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
fix: BOLA/IDOR: enforce process ownership on process and file APIs
chore: Update azure.yaml file to show github issue URL before provisioning
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
fix: Add posix in pre-deployment hook in azure.yaml
fix: downmerge from main to dev
Priyanka2-Microsoft
requested review from
Avijit-Microsoft,
Prajwal-Microsoft,
Roopan-Microsoft,
Vinay-Microsoft,
aniaroramsft,
dgp10801,
nchandhi,
sethsteenken and
toherman-msft
as code owners
July 20, 2026 07:02
Coverage Report •
|
|||||||||||||||||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds centralized process-ownership authorization enforcement to the backend API so that only the owning user can access or mutate a process (returning 404 for both “missing” and “not owner” to reduce information leakage). It also updates dependency pins across backend/processor/frontend and adds an azd preprovision hook message to aid deployment troubleshooting.
Changes:
- Introduces
verify_process_ownershipand applies it across process- and file-related API routes. - Adds/updates router tests to validate 404 behavior for missing/unowned processes and to ensure unauthorized calls do not perform side effects.
- Bumps multiple Python and Node dependencies and adds an
azure.yamlpreprovision informational hook.
Reviewed changes
Copilot reviewed 10 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/backend-api/src/app/libs/services/authorization.py | Adds centralized helper to verify process existence + ownership with 404 on failure. |
| src/backend-api/src/app/routers/router_process.py | Enforces ownership checks across process endpoints; preserves HTTPException handling. |
| src/backend-api/src/app/routers/router_files.py | Enforces ownership check for file upload to a process. |
| src/backend-api/src/tests/routers/test_router_process.py | Adds ownership enforcement tests across process endpoints. |
| src/backend-api/src/tests/routers/test_router_files.py | Adds ownership enforcement tests for file upload and missing process. |
| src/backend-api/pyproject.toml | Updates backend dependency pins (e.g., aiohttp/cryptography/python-multipart). |
| src/backend-api/uv.lock | Updates locked dependency resolution consistent with new pins. |
| src/processor/pyproject.toml | Updates processor dependency pins and transitive overrides. |
| src/processor/package-lock.json | Updates processor JS dependency lockfile (e.g., dompurify). |
| src/frontend/requirements.txt | Updates python-multipart pin for frontend service. |
| src/frontend/package.json | Updates npm overrides (e.g., form-data). |
| src/frontend/package-lock.json | Updates frontend JS dependency lockfile (multiple packages). |
| azure.yaml | Adds preprovision hook to print troubleshooting/issue link guidance. |
Files not reviewed (2)
- src/frontend/package-lock.json: Generated file
- src/processor/package-lock.json: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Avijit-Microsoft
approved these changes
Jul 21, 2026
Roopan-Microsoft
approved these changes
Jul 21, 2026
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.
Purpose
This pull request introduces a robust authorization layer to the backend API, ensuring that users can only access or modify processes they own. It does this by centralizing process ownership verification and applying it consistently across all process-related endpoints. The update also includes dependency upgrades and improved error handling. Additionally, new tests have been added to validate the ownership checks.
Authorization and Security Enhancements:
verify_process_ownershipfunction inauthorization.pythat checks both the existence of a process and that the requesting user is its owner, returning a 404 if either check fails to prevent information leaks.router_process.pyandrouter_files.pyto callverify_process_ownershipbefore performing any action, ensuring only process owners can access or modify their resources. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]HTTPExceptionis re-raised and not masked by generic 500 errors, preserving correct response codes for authorization failures. [1] [2] [3] [4]Testing Improvements:
test_router_files.py). [1] [2]user_idon process records to support ownership checks (test_router_process.py).Dependency Upgrades:
python-multipart,aiohttp, andcryptographyinpyproject.toml. [1] [2]DevOps Improvements:
azure.yamlto display a helpful message with troubleshooting instructions and a link to the issue tracker if deployment fails.Does this introduce a breaking change?
Golden Path Validation
Deployment Validation
What to Check
Verify that the following are valid
Other Information