Files
FolderShare/docs/CURRENT_STATE.md
T

48 lines
5.0 KiB
Markdown

# Foldershare current state
- Updated: 2026-11-25 for TASK-002 integration
- Inspected worktree: `/home/rob/projects/foldershare`
- TASK-002 integration base: `codex` at `cd6d6b3`
## Verified repository state
Before this reconciliation, the tracked tree contained the Flask API and React/Vite frontend described in `PROJECT_OVERVIEW.md`, with no tracked tests, CI workflow, or deployment instructions. Git had one worktree on `main` and no uncommitted or untracked changes. These are repository observations, not proof of working application behavior or a deployed service.
This reconciliation adds Context System 1.0 and Workflow 2.0 documentation only. No application code, configuration, or runtime behavior was changed.
## Current task and validation state
- TASK-001 is Complete. Captain accepted the snapshot script on 2026-11-04 after running it from the project root. The script writes ZIPs to ignored `docs/snapshots/`; `.worktrees/` is also ignored.
- No application tests, lint, build, or runtime checks were run as part of this documentation reconciliation.
- Captain approved TASK-001's branch/worktree convention. Future-task, general merge, and release conventions remain pending in `DECISIONS.md`.
- No manual-test/testtask adapter was found in tracked repository files.
## Known limitations of this record
Application behavior, deployment, and local database state have not been verified. Record confirmed issues here when supported by evidence; do not turn unverified concerns into accepted tasks.
## Static-source review: potential security/functionality gaps (2026-11-04)
These observations are based on the supplied ZIP source, **not runtime exploit tests**:
- `api/routes/user_routes.py`: GET list/detail check admin, but POST create, PATCH update, and DELETE do not check `is_admin`; any authenticated account may be able to modify accounts. Treat as release-blocking until verified/fixed. `get_user` also lacks a missing-user guard.
- `api/routes/file_routes.py`: POST `/api/file` accepts client-supplied `path` and `filename`, without an explicit user-root containment check; this risks unauthorized file download. This endpoint must not be exposed as-is.
- `api/models/user.py`: `get_file_list()` and the admin root listing expose absolute/server paths in tree data; the configured root is formed by string concatenation, without demonstrated canonical containment checks. Symlink handling and filesystem boundaries need review.
- `api/auth.py` / `api/models/user.py` / `api/routes/token_routes.py`: disabled-account/token-refresh behavior needs explicit security tests. Review refresh-cookie `Secure` and `SameSite` settings and token revocation on disable/delete.
- `react/src/components/FileBrowser/FileBrowser.jsx`: download icon is rendered but has no click handler; `apiBaseUrl` is hard-coded to a development URL and unused. End-to-end download flow is unverified.
- `api/routes/file_routes.py`: a nested-quote f-string in the 404 handler may cause a syntax error on some supported Python versions; run syntax/import checks early.
- 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.