mantimon-tcg/backend
Cal Corum 996c43fbd9 Implement Phase 2: Authentication system
Complete OAuth-based authentication with JWT session management:

Core Services:
- JWT service for access/refresh token creation and verification
- Token store with Redis-backed refresh token revocation
- User service for CRUD operations and OAuth-based creation
- Google and Discord OAuth services with full flow support

API Endpoints:
- GET /api/auth/{google,discord} - Start OAuth flows
- GET /api/auth/{google,discord}/callback - Handle OAuth callbacks
- POST /api/auth/refresh - Exchange refresh token for new access token
- POST /api/auth/logout - Revoke single refresh token
- POST /api/auth/logout-all - Revoke all user sessions
- GET/PATCH /api/users/me - User profile management
- GET /api/users/me/linked-accounts - List OAuth providers
- GET /api/users/me/sessions - Count active sessions

Infrastructure:
- Pydantic schemas for auth/user request/response models
- FastAPI dependencies (get_current_user, get_current_premium_user)
- OAuthLinkedAccount model for multi-provider support
- Alembic migration for oauth_linked_accounts table

Dependencies added: email-validator, fakeredis (dev), respx (dev)

84 new tests, 1058 total passing
2026-01-27 21:49:59 -06:00
..
app Implement Phase 2: Authentication system 2026-01-27 21:49:59 -06:00
data Simplify card image URLs to use set-based paths 2026-01-27 16:16:51 -06:00
project_plans Add detailed Phase 2 (Authentication) project plan 2026-01-27 16:25:57 -06:00
references Add database infrastructure with SQLAlchemy models and test suite 2026-01-27 10:17:30 -06:00
scripts Simplify card image URLs to use set-based paths 2026-01-27 16:16:51 -06:00
tests Implement Phase 2: Authentication system 2026-01-27 21:49:59 -06:00
.env.example Add database infrastructure with SQLAlchemy models and test suite 2026-01-27 10:17:30 -06:00
.gitignore Add backend foundation with uv, Black, and pre-commit hooks 2026-01-24 00:12:33 -06:00
.python-version Add backend foundation with uv, Black, and pre-commit hooks 2026-01-24 00:12:33 -06:00
alembic.ini Add database infrastructure with SQLAlchemy models and test suite 2026-01-27 10:17:30 -06:00
docker-compose.yml Implement Phase 2: Authentication system 2026-01-27 21:49:59 -06:00
PROJECT_PLAN_MASTER.json Add database infrastructure with SQLAlchemy models and test suite 2026-01-27 10:17:30 -06:00
pyproject.toml Implement Phase 2: Authentication system 2026-01-27 21:49:59 -06:00
uv.lock Implement Phase 2: Authentication system 2026-01-27 21:49:59 -06:00