Commit Graph
2 Commits
Author SHA1 Message Date
rin.kagamine 89f02a8de5 fix: auth API response format and test suite green
- API: login/register now return OAuth2-standard {access_token, token_type: 'bearer'}
  instead of {token} — matches frontend auth.ts expectations
- API: added has_api_key to login/register user responses
- API: password minimum changed from 8 to 6 characters (matches frontend)
- Tests: all 14 auth tests passing
  - Fixed token field name (access_token)
  - Fixed invite code insertion (use auth_mod DB path)
  - Fixed duplicate username test (400 not 409)
  - Added auth_mod.DB_PATH patch to both fixtures
  - Added aiosqlite direct DB inserts for test data
- Removed system Python pollution from earlier --break-system-packages
- Set up project venv (.venv) with all deps for local test runs
2026-05-31 13:31:25 -04:00
rin.kagamine 674abbbe8f test: add auth endpoint tests for single/multi mode
- 14 tests covering auth flow in both modes:
  - TestSingleMode: health shows single, /me returns null user, clips accessible without auth
  - TestMultiModeAuth: health shows multi, /me requires auth, clips require auth,
    admin login, wrong password, nonexistent user, valid token /me,
    clips with valid token, register with invite, invalid invite, duplicate username
- Tests require librosa (same as existing test_api.py) — pass in Docker CI
- Conftest fixture pattern matches existing app_client fixture
2026-05-31 12:24:22 -04:00