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
+4 -21
View File
@@ -1,26 +1,9 @@
# Foldershare handoff
This is a replaceable snapshot. Live repository/Git and maintained context take precedence.
Updated 2026-11-25. Captain accepted TASK-002 on 2026-11-07 and authorized committing it from `.worktrees/TASK-002` and integrating it locally into `codex` on 2026-11-25.
- Updated: 2026-11-04 (planning reconciliation from `foldershare-20261104-160824-012796.zip`)
- Snapshot documents report `codex` / `767b424` at the earlier inspection; live Git worktree, branch, status and HEAD **have not been checked** in this archive-only reconciliation.
- Files changed by patch: `docs/PROJECT_OVERVIEW.md`, `docs/DECISIONS.md`, `docs/CURRENT_STATE.md`, `docs/TASKS.md`, `docs/HANDOFF.md` only. No application code, no tests executed, no merge or deployment.
TASK-002 supplies the authorization and filesystem boundaries. Integration checks passed for ten API tests, Python syntax, the frontend production build and whitespace. The frontend lint script requires a missing ESLint configuration. Existing accounts with a `NULL` login flag are denied access, and existing host-absolute assignments need admin reassignment.
## Current outcome
Captain selected TASK-003 for briefing. It remains Accepted. Use the merged `codex` tip as the proposed base for `task/TASK-003-secure-browsing` in `.worktrees/TASK-003`, subject to approval when Captain engages the task. Reuse TASK-002's virtual roots and media containment for authenticated browsing. Preserve the admin-only folder picker and existing browser styling. Define the browse response and its stable file reference for TASK-004 during implementation.
Captain defined FolderShare as a private Pi-hosted, read-only browser/download service for named friends. V1: single assigned root per user, admin-controlled accounts, browse and single-file download using opaque filename-free URLs. Future: multi-select ZIP downloads. The patch records PRD-001 through PRD-004 and DEP-001, plus TASK-002 through TASK-006; security/auth fixes must precede exposure.
## Major static-source risks to address
`POST /api/file` trusts client path; user mutation routes lack admin checks; listing exposes host paths; download click is not wired; token/disabled behavior needs tests. See `CURRENT_STATE.md`. Do not expose this snapshot implementation to untrusted users.
## Next Codex action
1. In the **live repository**, read AGENTS/context documents and inspect branch, HEAD, git status, worktrees and existing changes before applying this patch. Check patch with `git apply --check`; do not overwrite later edits.
2. Apply documentation-only patch, review diff and report conflicts. Do **not** quietly replace newer state or start any implementation task.
3. Ask Captain to select TASK-002 as first implementation task and approve concrete integration branch/worktree conventions (live `codex` vs proposal `main`). Keep TASK-006 blocked pending remote access and target Pi choice.
4. Once authorized, create one isolated worktree for TASK-002, implement/test there, and submit a Captain-validation handoff. Do not merge or deploy without authority.
## Validation
Patch was generated from the exact supplied ZIP. No live Git or application validation can be claimed from the archive alone.
Validate browse access and failure states with disposable media and user fixtures, then verify the browser flow for assigned, unassigned and admin users. TASK-007 has a separate manual-test adapter awaiting Captain validation. Its integration or use for a later handoff is a separate decision.