forked from 0xWheatyz/SPARC
Add JWT auth flow tests covering registration, login, protected routes, and admin endpoints #930
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 tests in
tests/test_api.pybypass authentication entirely. The JWT flow (registration, login, token usage, refresh, and admin-only access) has no automated test coverage.Roadmap Reference
P1 Test coverage for auth and admin (ROADMAP.md)
What to do
tests/test_auth.py(or extendtest_api.py) with the following test cases:POST /auth/register-- successful registration returns 201 with a user object.POST /auth/login-- valid credentials return an access token and refresh token.GET /jobs) returns 401 without a token.Acceptance criteria
pytest tests/test_auth.pyexits 0 in CI.This issue has been resolved.
tests/test_auth.py(10,211 bytes) contains comprehensive JWT auth flow tests covering registration, login, protected routes, and admin endpoints. Closing as completed.