forked from 0xWheatyz/SPARC
Add JWT authentication tests covering full auth flow #433
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?
Summary
Existing API tests in
tests/test_api.pybypass authentication entirely. There is no test coverage for the JWT flow, leaving auth and admin-only endpoints unverified.What to do
tests/test_auth.py(or extendtest_api.py) covering:TestClientand mock or use a test database to avoid hitting production stateAcceptance Criteria
pytestwith no additional setup beyond the test databaseReference
Roadmap: P1 - Test coverage for auth and admin
Triage: Priority Wave 3 (P1 feature/test). Assigned. Dispatching agent for implementation.
Resolution: Already implemented.
tests/test_auth.pycovers all required scenarios:/auth/me): valid token works, missing token returns 401/403, expired token returns 401, refresh token as access returns 401.pytestin both CI workflows (build.yamlandtest.yaml).All acceptance criteria are met. Closing.