TASK-002 Enforce authorization and media boundaries
This commit is contained in:
@@ -68,3 +68,18 @@ Until approved, brief the concrete convention choice before creating later task
|
||||
## Pending: Git integration branch convention
|
||||
|
||||
The 2026-11-04 snapshot references work on `codex` while the existing proposal suggests `main`. There is no evidence that a general integration branch choice was approved. Before creating a task worktree, Codex must inspect live Git state and ask Captain to approve the integration base, worktree path, and eventual merge destination. A task branch is not authority to merge or deploy.
|
||||
|
||||
## WF-003: TASK-002 implementation location
|
||||
|
||||
- Status: Accepted by Captain's “engage task-002” response to the concrete proposal, 2026-11-04.
|
||||
- Use `codex` at `cd6d6b3` as TASK-002 base and intended merge destination, branch `task/TASK-002-authorization`, worktree `.worktrees/TASK-002`.
|
||||
- This approves TASK-002 only. Merge/deployment authority remains with Captain; future-task/release conventions remain pending. The earlier main-base proposal is not used for this task.
|
||||
|
||||
## TASK-002 API/security implementation contract
|
||||
|
||||
- Implements PRD-002: stored assigned roots are virtual `/` or `/folder/descendant`, relative to configured `ROOT_PATH`; `null` grants no access. Existing malformed/host-absolute assignments fail closed and require admin reassignment. No automatic conversion of old assignments.
|
||||
- Symlinks inside the media tree are omitted/rejected entirely (including links within the tree). Descriptor-relative directory opens with `O_NOFOLLOW` prevent listing redirection during link swaps; Linux/Pi is the target runtime.
|
||||
- Admin `GET /api/file/root` retains tree entries `{root, dirs, files}` with virtual roots, filename/size metadata; unavailable media returns generic 503. The model's user listing rebases its assigned directory to `/` and returns `[]` when unassigned/invalid/unavailable. TASK-003 supplies the user-facing browse route/UI.
|
||||
- `POST /api/file` returns authenticated 410 without reading its payload or filesystem until TASK-004 replaces downloads with authorized grants. Anonymous requests remain 401.
|
||||
- User POST/PATCH/DELETE require admin (authenticated non-admin 403); POST accepts username/password only, PATCH root/login_disabled only with validated types. Disabled/missing users cannot use Basic/access/refresh authentication; disabling revokes credentials so re-enabling does not restore them.
|
||||
- `FOLDERSHARE_DATABASE_URI` optionally overrides SQLite configuration for isolated tests; default database remains unchanged. `ROOT_PATH` still configures media, resolved from process working directory at startup.
|
||||
|
||||
Reference in New Issue
Block a user