Commit Graph

386 Commits

Author SHA1 Message Date
d541b92253 Merge pull request 'chore(deps): update dependency @tanstack/react-query to v5.94.5' (#78) from renovate/tanstack-react-query-5.x into develop
Some checks failed
CI / frontend-tests (push) Has been cancelled
CI / backend-tests (push) Has been cancelled
Reviewed-on: #78
2026-03-22 09:25:37 +01:00
79ad7b9133 chore: update bean 2026-03-22 09:23:12 +01:00
50ed370d24 Merge pull request 'Add optional TOTP MFA for email/password accounts' (#76) from feature/optional-totp-mfa into develop
All checks were successful
CI / backend-tests (push) Successful in 31s
CI / frontend-tests (push) Successful in 29s
Reviewed-on: #76
2026-03-22 09:21:33 +01:00
8be9718293 Merge pull request 'Enforce run ownership and show owner info' (#74) from feature/enforce-run-ownership-on-all-mutation-endpoints into develop
All checks were successful
CI / backend-tests (push) Successful in 29s
CI / frontend-tests (push) Successful in 29s
Reviewed-on: #74
2026-03-22 09:16:54 +01:00
38b1156a95 Merge branch 'develop' into feature/enforce-run-ownership-on-all-mutation-endpoints
All checks were successful
CI / backend-tests (pull_request) Successful in 33s
CI / frontend-tests (pull_request) Successful in 29s
2026-03-22 09:16:36 +01:00
596393d5b8 Merge pull request 'Infer genlocke visibility from first leg's run' (#77) from feature/infer-genlocke-visibility-from-first-legs-run into feature/enforce-run-ownership-on-all-mutation-endpoints
All checks were successful
CI / backend-tests (pull_request) Successful in 29s
CI / frontend-tests (pull_request) Successful in 29s
Reviewed-on: #77
2026-03-22 09:15:16 +01:00
c064a1b8d4 chore: bean organisation 2026-03-22 08:56:06 +01:00
f17687d2fa fix: resolve merge conflict in bean t9aj
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 22:50:19 +01:00
Renovate Bot
e279fc76ee chore(deps): update dependency @tanstack/react-query to v5.94.5
All checks were successful
CI / backend-tests (pull_request) Successful in 27s
CI / frontend-tests (pull_request) Successful in 28s
2026-03-21 16:01:57 +00:00
7a828d7215 feat: add optional TOTP MFA for email/password accounts
All checks were successful
CI / backend-tests (pull_request) Successful in 26s
CI / frontend-tests (pull_request) Successful in 28s
- Add MFA enrollment UI in new Settings page with QR code and backup secret
- Add TOTP challenge step to login flow for enrolled users
- Check AAL after login and show TOTP input when aal2 required
- Add disable MFA option with TOTP re-verification
- Only show MFA options for email/password users (not OAuth)
- Add Settings link to user dropdown menu

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 13:56:48 +01:00
a4fa5bf1e4 feat: infer genlocke visibility from first leg's run
Genlockes now inherit visibility from their first leg's run:
- Private runs make genlockes hidden from public listings
- All genlocke read endpoints now accept optional auth
- Returns 404 for private genlockes to non-owners

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 13:47:05 +01:00
a3f332f82b feat: show owner info in admin pages
All checks were successful
CI / backend-tests (pull_request) Successful in 29s
CI / frontend-tests (pull_request) Successful in 29s
- Add Owner column to AdminRuns.tsx and AdminGenlockes.tsx
- Add owner filter dropdown to both admin pages
- Add owner field to GenlockeListItem schema (resolved from first leg's run)
- Update frontend types for GenlockeListItem

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 13:38:08 +01:00
3bd24fcdb0 fix: hide edit controls for non-owners in frontend
- Add useAuth and canEdit logic to RunEncounters.tsx
- Guard all mutation triggers (Log Shiny, Log Egg, End Run, Randomize All,
  HoF Edit, Boss Battle, route/team clicks, Advance to Next Leg)
- Update RunDashboard.tsx canEdit to be isOwner only (no unowned fallback)
- Add read-only banner for non-owner viewers in both pages

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 13:33:04 +01:00
eeb1609452 fix: enforce run ownership on all mutation endpoints
Add require_run_owner helper in auth.py that enforces ownership on
mutation endpoints. Unowned (legacy) runs are now read-only.

Applied ownership checks to:
- All 4 encounter mutation endpoints
- Both boss result mutation endpoints
- Run update/delete endpoints
- All 5 genlocke mutation endpoints (via first leg's run owner)

Also sets owner_id on run creation in genlockes.py (create_genlocke,
advance_leg) and adds 22 comprehensive ownership enforcement tests.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-21 13:28:47 +01:00
a12958ae32 update beans and postgres mount path
All checks were successful
CI / backend-tests (push) Successful in 27s
CI / frontend-tests (push) Successful in 29s
2026-03-21 12:51:35 +01:00
7e7c5e7536 Merge pull request 'fix: TypeScript build errors in RunEncounters.tsx' (#71) from feature/fix-typescript-build-errors-in-runencounterstsx into develop
All checks were successful
CI / backend-tests (push) Successful in 27s
CI / frontend-tests (push) Successful in 29s
Reviewed-on: #71
2026-03-21 12:26:34 +01:00
5c10041b8b fix: TypeScript build errors in RunEncounters.tsx
All checks were successful
CI / backend-tests (pull_request) Successful in 27s
CI / frontend-tests (pull_request) Successful in 29s
Use explicit BossResult type instead of indexing potentially undefined
typeof bossResults. Add BossResultTeamMember type to tm parameter.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 12:25:20 +01:00
7276f05dd2 Merge pull request 'feat: add Supabase auth config to production Docker setup' (#69) from feature/add-supabase-auth-config-to-production-docker-setup into develop
All checks were successful
CI / backend-tests (push) Successful in 29s
CI / frontend-tests (push) Successful in 29s
Reviewed-on: #69
2026-03-21 12:19:29 +01:00
7b0cd16064 feat: write production .env from Gitea secrets during deploy
All checks were successful
CI / backend-tests (pull_request) Successful in 26s
CI / frontend-tests (pull_request) Successful in 28s
Instead of relying on a pre-existing .env file on the server, the
deploy workflow now writes POSTGRES_PASSWORD and SUPABASE_JWT_SECRET
from Gitea secrets. This keeps all secret management in one place.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 12:17:59 +01:00
7cd3372c7e feat: add Supabase auth config to production Docker setup
All checks were successful
CI / backend-tests (pull_request) Successful in 26s
CI / frontend-tests (pull_request) Successful in 29s
- Pass SUPABASE_JWT_SECRET to backend in docker-compose.prod.yml
- Add build args (VITE_API_URL, VITE_SUPABASE_URL, VITE_SUPABASE_ANON_KEY)
  to Dockerfile.prod so Vite inlines them at build time
- Pass build args from secrets in deploy workflow
- Add build section to frontend service in docker-compose.prod.yml

No GoTrue container needed in prod — Supabase Cloud hosts the auth
service. The backend only needs the JWT secret to verify tokens.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 12:07:53 +01:00
d1d9a60134 Merge pull request 'chore(deps): update dependency jsdom to v29' (#62) from renovate/jsdom-29.x into develop
All checks were successful
CI / backend-tests (push) Successful in 27s
CI / frontend-tests (push) Successful in 28s
Reviewed-on: #62
2026-03-21 12:04:26 +01:00
Renovate Bot
ecff53ef58 chore(deps): update dependency jsdom to v29
All checks were successful
CI / backend-tests (pull_request) Successful in 27s
CI / frontend-tests (pull_request) Successful in 29s
2026-03-21 11:02:05 +00:00
0f1d205176 Merge pull request 'chore(deps): update supabase/gotrue docker tag to v2.188.1' (#68) from renovate/supabase-gotrue-2.x into develop
All checks were successful
CI / backend-tests (push) Successful in 28s
CI / frontend-tests (push) Successful in 28s
2026-03-21 12:02:02 +01:00
e1904b818e Merge pull request 'chore(deps): update postgres docker tag to v18' (#66) from renovate/postgres-18.x into develop
Some checks failed
CI / backend-tests (push) Has been cancelled
CI / frontend-tests (push) Has been cancelled
2026-03-21 12:01:35 +01:00
100d2d72d0 Merge pull request 'chore(deps): update node docker tag to v25' (#65) from renovate/node-25.x into develop
Some checks failed
CI / backend-tests (push) Has been cancelled
CI / frontend-tests (push) Has been cancelled
2026-03-21 12:01:27 +01:00
0d6d0d512c Merge pull request 'chore(deps): update dependency @vitejs/plugin-react to v6' (#60) from renovate/vitejs-plugin-react-6.x into develop
Some checks failed
CI / backend-tests (push) Has been cancelled
CI / frontend-tests (push) Has been cancelled
2026-03-21 12:00:59 +01:00
Renovate Bot
99f2676c15 chore(deps): update dependency @vitejs/plugin-react to v6
All checks were successful
CI / backend-tests (pull_request) Successful in 27s
CI / frontend-tests (pull_request) Successful in 29s
2026-03-21 10:59:05 +00:00
8476f1fa69 Merge pull request 'chore(deps): update dependency vite to v8' (#64) from renovate/vite-8.x into develop
All checks were successful
CI / backend-tests (push) Successful in 30s
CI / frontend-tests (push) Successful in 29s
2026-03-21 11:56:39 +01:00
Renovate Bot
bcc0239f6a chore(deps): update postgres docker tag to v18
All checks were successful
CI / backend-tests (pull_request) Successful in 26s
CI / frontend-tests (pull_request) Successful in 30s
2026-03-21 10:49:30 +00:00
Renovate Bot
e979b875ec chore(deps): update node docker tag to v25
All checks were successful
CI / backend-tests (pull_request) Successful in 28s
CI / frontend-tests (pull_request) Successful in 29s
2026-03-21 10:49:23 +00:00
Renovate Bot
5957ac5558 chore(deps): update dependency vite to v8
All checks were successful
CI / backend-tests (pull_request) Successful in 27s
CI / frontend-tests (pull_request) Successful in 29s
2026-03-21 10:49:08 +00:00
Renovate Bot
f70bebfb26 chore(deps): update supabase/gotrue docker tag to v2.188.1
All checks were successful
CI / backend-tests (pull_request) Successful in 28s
CI / frontend-tests (pull_request) Successful in 29s
2026-03-21 10:48:32 +00:00
993cd25fbb Merge pull request 'chore(deps): update actions/upload-artifact action to v7' (#59) from renovate/actions-upload-artifact-7.x into develop
All checks were successful
CI / backend-tests (push) Successful in 30s
CI / frontend-tests (push) Successful in 30s
2026-03-21 11:46:01 +01:00
7265905866 Merge pull request 'chore(deps): update dependency pyjwt to v2.12.1' (#61) from renovate/pyjwt-2.x into develop
Some checks failed
CI / frontend-tests (push) Has been cancelled
CI / backend-tests (push) Has been cancelled
2026-03-21 11:45:56 +01:00
e8ded9184b feat: auth-aware UI and role-based access control (#67)
All checks were successful
CI / backend-tests (push) Successful in 32s
CI / frontend-tests (push) Successful in 29s
## Summary

- Add `is_admin` column to users table with Alembic migration and a `require_admin` FastAPI dependency that protects all admin-facing write endpoints (games, pokemon, evolutions, bosses, routes CRUD)
- Expose admin status to frontend via user API and update AuthContext to fetch/store `isAdmin` after login
- Make navigation menu auth-aware (different links for logged-out, logged-in, and admin users) and protect frontend routes with `ProtectedRoute` and `AdminRoute` components, preserving deep-linking through redirects
- Fix test reliability: `drop_all` before `create_all` to clear stale PostgreSQL enums from interrupted test runs
- Fix test auth: add `admin_client` fixture and use valid UUID for mock user so tests pass with new admin-protected endpoints

## Test plan

- [x] All 252 backend tests pass
- [ ] Verify non-admin users cannot access admin write endpoints (games, pokemon, evolutions, bosses CRUD)
- [ ] Verify admin users can access admin endpoints normally
- [ ] Verify navigation shows correct links for logged-out, logged-in, and admin states
- [ ] Verify `/admin/*` routes redirect non-admin users with a toast
- [ ] Verify `/runs/new` and `/genlockes/new` redirect unauthenticated users to login, then back after auth

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Reviewed-on: #67
Co-authored-by: Julian Tabel <juliantabel.jt@gmail.com>
Co-committed-by: Julian Tabel <juliantabel.jt@gmail.com>
2026-03-21 11:44:05 +01:00
f7731b0497 Fix local login flow, add new auth epic
Some checks failed
CI / backend-tests (push) Failing after 31s
CI / frontend-tests (push) Successful in 29s
2026-03-21 11:06:53 +01:00
0d6174067e feat: enforce feature branch workflow with PreToolUse hook
Add a guard script that blocks git commit/push on protected branches
(develop, main, master) via a PreToolUse hook. Update CLAUDE.md with
stricter branching rules: one commit per task, immediate commits on
feature branches, no direct commits to protected branches.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 10:45:58 +01:00
93a90f4ba7 add docker init folder
Some checks failed
CI / backend-tests (pull_request) Failing after 1m11s
CI / frontend-tests (pull_request) Successful in 28s
2026-03-20 22:13:01 +01:00
3d362a8314 Last weird branch commit
Some checks failed
CI / backend-tests (pull_request) Failing after 1m16s
CI / frontend-tests (pull_request) Successful in 28s
2026-03-20 22:11:39 +01:00
Renovate Bot
5185a251f4 chore(deps): update dependency pyjwt to v2.12.1
Some checks failed
CI / backend-tests (pull_request) Failing after 1m10s
CI / frontend-tests (pull_request) Successful in 28s
2026-03-20 21:02:21 +00:00
2364922b58 beans update 2026-03-20 21:59:43 +01:00
3881971214 chore: add .talos/ to .gitignore
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 21:42:52 +01:00
0a519e356e feat: add auth system, boss pokemon details, moves/abilities API, and run ownership
Some checks failed
CI / backend-tests (push) Failing after 1m16s
CI / frontend-tests (push) Successful in 57s
Add user authentication with login/signup/protected routes, boss pokemon
detail fields and result team tracking, moves and abilities selector
components and API, run ownership and visibility controls, and various
UI improvements across encounters, run list, and journal pages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 21:41:38 +01:00
a6cb309b8b chore: archive 42 completed/scrapped beans
All checks were successful
CI / backend-tests (push) Successful in 28s
CI / frontend-tests (push) Successful in 28s
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 21:31:23 +01:00
Renovate Bot
106156b73d chore(deps): update actions/upload-artifact action to v7
All checks were successful
CI / backend-tests (pull_request) Successful in 26s
CI / frontend-tests (pull_request) Successful in 4m36s
2026-03-20 20:03:14 +00:00
27c89ccf2b Merge pull request 'chore(deps): update dependency oxlint to v1.56.0' (#51) from renovate/oxlint-1.x into develop
All checks were successful
CI / backend-tests (push) Successful in 25s
CI / frontend-tests (push) Successful in 1m21s
Reviewed-on: #51
2026-03-20 20:17:14 +01:00
ccabf3bdf3 Merge pull request 'chore(deps): update actions/checkout action to v6' (#57) from renovate/actions-checkout-6.x into develop
Some checks failed
CI / frontend-tests (push) Has been cancelled
CI / backend-tests (push) Has been cancelled
Reviewed-on: #57
2026-03-20 20:17:00 +01:00
55484a047d Merge pull request 'chore(deps): update actions/setup-node action to v6' (#58) from renovate/actions-setup-node-6.x into develop
Some checks failed
CI / frontend-tests (push) Has been cancelled
CI / backend-tests (push) Has been cancelled
Reviewed-on: #58
2026-03-20 20:16:44 +01:00
Renovate Bot
7c11902613 chore(deps): update actions/setup-node action to v6
All checks were successful
CI / backend-tests (pull_request) Successful in 25s
CI / frontend-tests (pull_request) Successful in 58s
2026-03-20 19:03:48 +00:00
Renovate Bot
24646d30c6 chore(deps): update actions/checkout action to v6
All checks were successful
CI / backend-tests (pull_request) Successful in 37s
CI / frontend-tests (pull_request) Successful in 29s
2026-03-20 19:03:42 +00:00