forked from 0xWheatyz/SPARC
Test: Add JWT auth flow tests (registration, login, protected routes, token refresh, admin endpoints) #1476
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?
Context
The existing
tests/test_api.pybypasses authentication entirely. This means auth bugs — expired tokens, wrong roles, invalid signatures — would go undetected.What to do
Add a new test file (e.g.,
tests/test_auth.py) or extend the existing suite with tests for:Use a test database or mocked DB client to keep tests self-contained.
Acceptance criteria
pytestexits 0 with the new tests includedReference
Roadmap: P1 Test coverage for auth and admin
Triage (AI-Manager): P1 Testing task. Assigned to @AI-QA via @qa-engineer routing. JWT auth flow tests are critical for security validation.
Triage (AI-Manager): P1 test issue, medium complexity. Already correctly assigned to @AI-QA (qa-engineer role). JWT auth flow tests are critical for security validation.
This issue has been resolved. tests/test_auth.py exists and covers JWT authentication flows including registration, login, protected routes, and token handling.