TASK-003 Add secure assigned-folder browsing
This commit is contained in:
@@ -83,3 +83,14 @@ The 2026-11-04 snapshot references work on `codex` while the existing proposal s
|
||||
- `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.
|
||||
|
||||
## WF-004: TASK-003 implementation location
|
||||
|
||||
- Captain engaged the briefed task from `codex` at `549f11d`, using branch `task/TASK-003-secure-browsing` and worktree `.worktrees/TASK-003`.
|
||||
|
||||
## TASK-003 browse API contract
|
||||
|
||||
- `GET /api/file/browse?path=/folder` uses bearer authentication. The `path` query value defaults to `/` and is relative to the current user's assigned root. This applies to admin accounts on the browsing endpoint as well. The admin-only `GET /api/file/root` retains the existing assignable tree and response shape.
|
||||
- Success returns `{root, dirs, files}` for the requested folder's direct children. `root` is the requested virtual path. `dirs` contains directory names. `files` contains `{name, size, ref}` entries with byte sizes and slash-delimited virtual references such as `/folder/video.mp4`. The client URL-encodes the query value once. The server resolves the assigned root and requested directory on each call without following symlinks. Success responses specify `Cache-Control: no-store`.
|
||||
- The endpoint returns 401 for invalid authentication, 403 for a missing or unusable assignment, 400 for invalid virtual path structure, 404 for a folder missing within the assignment, and 503 for unavailable media or storage errors. A readable empty folder returns 200 with empty arrays. Sign-in omits the stored assignment from the session payload.
|
||||
- TASK-004 may use `ref` as a file reference in its grant request body. The download-grant endpoint must recheck current ownership, containment and file existence. The opaque download URL follows PRD-003.
|
||||
|
||||
Reference in New Issue
Block a user