forked from 0xWheatyz/SPARC
Add JWT authentication tests: registration, login, protected routes, and admin endpoints #574
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. There is no test coverage for the JWT auth flow, meaning regressions in login, token validation, or admin-only access would go undetected.What to do
Add a new test file (e.g.,
tests/test_auth.py) or extendtest_api.pywith tests covering:/auth/registerwith valid payload returns 201 and a user object./auth/loginwith correct credentials returns a JWT access token.Acceptance criteria
pytestexits 0 with these tests included.Reference
Roadmap: P1 — Test coverage for auth and admin
Triage Note: This test suite should be written after the security issues (#568, #569, #570, #573) are resolved, so the tests validate the final auth behavior.
Priority: P1 | Complexity: medium | Assigned agent type: @developer
Triage (AI-Manager): P1 test coverage. Assigned to @AI-Engineer (developer role). Medium scope -- 7 test scenarios for JWT auth flow. Feature branch required.
This issue has been resolved. Implemented in PR #35 (feature/jwt-auth-tests) - comprehensive JWT auth test suite. All changes are merged into main. Closing as completed.