Commit graph

3 commits

Author SHA1 Message Date
ZTatman
b6486b7d5a fix(web): address CodeRabbit review comments
- Fix logout cookie not reaching browser (same pattern as callback)
- Add cascade delete on Grant.user_id FK
- Bump httpx to >=0.28.1
- Return plain dict from /dashboard instead of ORM session
- Add decrypt functions and key validation to crypto.py
- Constrain session token_hash to String(64), add expires_at index
- Move Session import to TYPE_CHECKING in user.py
- Add indexes on email and LinkedIdentity.user_id
2026-05-15 15:11:58 -04:00
ZTatman
d382ad348f feat(web): OAuth CSRF protection, refactor, and cleanup
- Add CSRF state parameter to Forgejo OAuth flow
- Refactor callback route into focused helper functions
- Remove unused FORGEJO_PAT config from web service
- Add pat_encrypted field to User model
- Fix circular imports with TYPE_CHECKING guards
- Fix session cookie not reaching browser (secure=True + response object)
- Add ruff linting/formatting to web project
- Add env_file to docker-compose for OAuth credentials
- Document OAuth setup steps in README
2026-05-15 13:40:50 -04:00
ZTatman
5fec547983 feat(web): Forgejo OAuth, Myst sessions, and auth schema
Implement Myst-owned sessions after Forgejo OAuth per auth design: User and
LinkedIdentity with encrypted OAuth tokens, Session in its own module,
Grant token_hash plus user_id and expires_at. Add auth/identity and
auth/session helpers, Forgejo login/callback/logout routes, and a minimal
/dashboard that requires get_current_session.

Move get_db to app/deps.py so routers and auth avoid importing app.main.
Add httpx and cryptography; extend Settings with OAuth client fields,
optional MYST_PUBLIC_BASE_URL for redirect_uri, and OAUTH_TOKEN_ENCRYPTION_KEY
(Fernet) required when persisting OAuth tokens.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-12 15:12:17 -04:00