TASK-002 Enforce authorization and media boundaries

This commit is contained in:
rob
2026-11-25 17:24:12 +00:00
parent cd6d6b3a83
commit 549f11d9f4
14 changed files with 374 additions and 92 deletions
+13 -2
View File
@@ -1,8 +1,8 @@
# Foldershare current state
- Updated: 2026-11-04
- Updated: 2026-11-25 for TASK-002 integration
- Inspected worktree: `/home/rob/projects/foldershare`
- Branch and HEAD at inspection: `codex` at `767b424`
- TASK-002 integration base: `codex` at `cd6d6b3`
## Verified repository state
@@ -34,3 +34,14 @@ These observations are based on the supplied ZIP source, **not runtime exploit t
- Tests and production deployment are still unverified. The ZIP is not a live Git repository; its HEAD/branch are historical snapshot metadata.
No source-code security fixes or runtime validation are part of this reconciliation patch.
## TASK-002 authorization and filesystem boundaries
Captain accepted TASK-002 on 2026-11-07 and authorized its local integration into `codex` on 2026-11-25. These verified changes supersede the corresponding snapshot observations above.
- User mutations require an admin. Disabled accounts are denied Basic, access-token and refresh authentication. Disabling an account revokes its credentials. A missing user detail returns 404 and an invalid refresh identity returns 401.
- The media helper validates virtual assigned roots and uses directory descriptors to keep listings within those roots, excluding symlinks. `GET /api/file/root` is admin-only and returns virtual paths. The old download route returns 410.
- Login issues access tokens on first sign-in and after logout, and the login and refresh responses agree on user identity. The Users page now shows loading, empty and request-error states.
- The authentication checks require `login_disabled = false`. Rows left `NULL` by the old nullable migration are denied authentication. Existing invalid or host-absolute folder assignments require admin reassignment to virtual paths. TASK-002 includes no data migration, and local account and assignment data were not inspected.
- On 2026-11-25, all ten API tests passed with disposable SQLite and media fixtures. Python syntax checks, frontend production build and diff checks passed. Frontend lint could not run because ESLint configuration is missing. Python datetime and Sass deprecation warnings remain.
- TASK-003 covers ordinary-user browsing, TASK-004 covers download grants and resume, and TASK-005 covers the rest of the admin workflow. Target-Pi deployment and cookie/TLS configuration remain unverified. TASK-007's manual-test adapter awaits separate Captain validation in its own worktree.