test(phase-09): complete UAT — 9/9 tests passed; mark phase complete
All 9 UAT items verified via live API + source inspection: - GET /api/admin/overview live data (78 users, 8MB storage, 10 audit rows) - Auth guard: 401 unauthenticated, 403 non-admin on all protected endpoints - Admin login redirect (D-08) confirmed in LoginView.vue line 212 - Sidebar: 5 nav links, indigo Admin badge, no back-to-app link - 4-stat-card overview + When/Event/Actor/Target/IP audit table - 5 standalone admin views (Users, Quotas, AI, Audit) with no Pinia stores - API key write-only invariant confirmed in AdminAiView.vue - Color-coded audit badges (auth=blue, admin=amber, folder/share=purple) - to.matched.some() guard covers all /admin/* child routes - No sensitive fields (password_hash, credentials_enc) in any response Phase 9 marked complete. STATE.md and PROJECT.md updated for Phase 10. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
3363e23436
commit
e6f5f2be3b
@@ -65,10 +65,10 @@ Every user's documents — and the credentials they use to store them — are in
|
||||
|
||||
## Context
|
||||
|
||||
- **Current state**: v0.2 in progress — Phase 8 complete (2026-06-12). Backend routers decomposed into focused sub-packages, frontend API client decomposed into domain modules, Vite 6 shipped, CVEs resolved. Phase 9 (Admin Panel Rearchitecture) up next.
|
||||
- **Current state**: v0.2 in progress — Phase 9 complete (2026-06-13). Admin panel rearchitected as standalone /admin/* route subtree with AdminLayout, 5 dedicated views, corrected Vue Router 4 guard, admin login redirect, and new GET /api/admin/overview backend endpoint. Phase 10 (UX & Interaction) up next.
|
||||
- **Tech stack**: FastAPI 0.136+ (Python 3.12), SQLAlchemy 2.0 async, Alembic, MinIO SDK; Vue 3 (Options API), Pinia, Vue Router 4, Vite, Tailwind CSS.
|
||||
- **Code quality**: v0.1 was built feature-first under time pressure. Both backend and frontend contain duplication, inconsistent patterns, and components that grew beyond their original scope. v0.2 addresses this systematically.
|
||||
- **Admin panel**: AdminView.vue currently renders admin functionality as tabs appended to the main user layout. This is architecturally wrong — the admin interface needs its own route subtree, layout component, and nav.
|
||||
- **Admin panel**: Now a standalone /admin/* route subtree with AdminLayout as the route component, AdminSidebar with 5 nav links, and 5 dedicated view components. Old AdminView.vue and tab components deleted. Admin users are redirected to /admin on login; non-admin users are blocked from /admin/* by a correct to.matched.some() guard.
|
||||
- **Privacy constraint**: Admin role is a platform operator, not a content viewer. Cloud credentials encrypted with per-user HKDF key; API keys encrypted with separate HKDF domain. Neither is ever in an API response.
|
||||
|
||||
## Constraints
|
||||
@@ -99,6 +99,9 @@ Every user's documents — and the credentials they use to store them — are in
|
||||
| Sub-routers carry NO prefix | Parent `include_router(sub, prefix=...)` propagates; sub-router with own prefix causes double-segment URLs | Discovered during Phase 8 backend decomposition |
|
||||
| FastAPI 0.128+ empty-path restriction | `@router.get("")` on a sub-router with empty include prefix raises `FastAPIError` — register root routes on parent aggregator directly | Discovered Phase 8; affects all future sub-router patterns |
|
||||
| Vite 6 upgrade | Resolved two moderate CVEs (CVE-2026-39363/39364) present in Vite 5; build time unchanged | Shipped Phase 8 (PERF-01) |
|
||||
| Admin login redirect (D-08) | Role check fires before router.push — admin → /admin, regular user → /; D-09 guard as belt-and-suspenders | Shipped Phase 9 |
|
||||
| Tailwind safelist with regex patterns | Dynamic color classes (sky=OneDrive, amber=admin audit badges) are tree-shaken without explicit safelist | Regex patterns cover all provider and event-type color families in tailwind.config.js |
|
||||
| GET /api/admin/overview as dedicated endpoint | Aggregated stats (user count, storage, doc status, recent audit) served in one request to avoid N+1 on admin load | Shipped Phase 9 (09-01) |
|
||||
|
||||
## Evolution
|
||||
|
||||
@@ -118,4 +121,4 @@ This document evolves at phase transitions and milestone boundaries.
|
||||
4. Update Context with current state
|
||||
|
||||
---
|
||||
*Last updated: 2026-06-12 — after Phase 8*
|
||||
*Last updated: 2026-06-13 — after Phase 9*
|
||||
|
||||
Reference in New Issue
Block a user