forked from 0xWheatyz/SPARC
Test: add JWT authentication flow tests to test_api.py #1315
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
The existing
tests/test_api.pybypasses authentication entirely. There is no test coverage for the JWT lifecycle — registration, login, using a token to access a protected route, token refresh, or admin-only endpoint enforcement.What to do
Add test cases covering:
Acceptance criteria
pytest.auth.pyincreases measurably (target: >80%).References
Roadmap: P1 Test coverage for auth and admin.
Already resolved. Comprehensive JWT auth flow tests exist in
tests/test_auth.py: registration, login, token refresh, protected routes, expired tokens, refresh-as-access rejection, admin access control, role changes, and self-role-change prevention.