forked from 0xWheatyz/SPARC
Add JWT auth flow tests: registration, login, protected routes, token refresh, admin endpoints #1381
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Background
Roadmap item: P1 Test coverage for auth and admin
The existing
tests/test_api.pybypasses authentication entirely, leaving the JWT flow untested. Auth bugs (broken token validation, missing admin checks, insecure refresh) could go undetected.Task
Add a new test file (or extend
test_api.py) covering:Acceptance Criteria
pytestand pass in CI without external services (mock or test DB acceptable).auth.pyincreases to at least 80%.Reference
See ROADMAP.md § P1 Test coverage for auth and admin.
Resolved by PR #35 (merged). Comprehensive JWT auth flow tests exist in
tests/test_auth.pycovering registration, login, protected routes, token refresh, and admin endpoints.