fix: qualify backend JWT and multipart security updates - #14
Merged
Merged
Conversation
There was a problem hiding this comment.
Confidence Score: 4/5
Summary
Upgrades backend security dependencies and adds regression coverage with Python 3.12/3.13 CI. No runtime regression was reproduced; two minor documentation and typing issues remain.
Important Files Changed
| File | Overview |
|---|---|
| .github/workflows/backend-tests.yml | Adds Python 3.12/3.13 tests and dependency auditing |
| backend/requirements.txt | Updates JWT, multipart, FastAPI, and Starlette dependencies |
| backend/tests/README.md | Documents qualification boundaries but omits CI’s pip-upgrade prerequisite |
| backend/tests/test_security_dependencies.py | Adds 17 regression cases without required function annotations |
| From the repository root, using Python 3.12 (the backend container version) or 3.13: | ||
|
|
||
| ```bash | ||
| python -m pip install -r backend/requirements.txt pytest pip-audit |
There was a problem hiding this comment.
Add CI’s pip-upgrade step; these commands fail auditing in fresh Python 3.12.3 environments because bundled pip 24.0 has vulnerabilities unrelated to backend dependencies.
|
|
||
|
|
||
| @pytest.fixture | ||
| def auth_client(monkeypatch): |
There was a problem hiding this comment.
Add parameter and return annotations to the new fixtures and test functions, as required by sops.md’s public-function typing standard.
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.
Updates the backend JWT and multipart dependencies and adds executable authentication/parser regression coverage. Also updates FastAPI to 0.136.3 and pins Starlette 1.6.0 because the previous FastAPI pin forced a Starlette version with known vulnerabilities. Application routes and authentication logic are unchanged.
Validation: 17 passed on Python 3.12 and 3.13; four security regressions fail against the original dependency set; pip-audit reports no known vulnerabilities; Ruff and diff checks pass. Database/OAuth collaborators are mocked, so this is not live service or deployment evidence.
Release references: PyJWT 2.13.0, python-multipart 0.0.31, FastAPI 0.136.3.
Note
Medium Risk
Dependency major/minor bumps on auth and request-parsing stacks warrant regression coverage; app route logic is unchanged but session validation behavior depends on PyJWT/Starlette versions.
Overview
Bumps backend security-related dependencies and adds CI plus regression tests to qualify the upgrades without changing application auth routes.
backend/requirements.txtmoves FastAPI to0.136.3, explicitly pins Starlette1.6.0, and updates PyJWT (2.13.0) and python-multipart (0.0.31).A new GitHub Actions workflow (
backend-tests.yml) runsbackend/testson Python 3.12 and 3.13, thenpip-audit, only whenbackend/**changes.backend/tests/README.mddocuments local runs and clarifies that the maintained suite is separate from broken roottests/artifacts.test_security_dependencies.pyadds ~17 tests against real/api/auth/*, health, and OpenAPI (mocked DB/OAuth), plus an isolated FastAPI harness for multipart/urlencoded edge cases (JWT invalid cases, bearer vs cookie, OAuth cookie flags, etc.).Reviewed by Cursor Bugbot for commit 2b92ce4. Bugbot is set up for automated code reviews on this repo. Configure here.