ZDDC/zddc/internal
ZDDC 81e065e5b0 feat(zddc): GET /dir/?zip=1 — stream an ACL-filtered .zip of a subtree
zddc-server can now hand back a whole directory subtree as a single
streamed application/zip download: GET /some/dir/?zip=1 (works on both
/dir and /dir/) → Content-Type: application/zip + Content-Disposition:
attachment; filename="<dir>.zip", containing every readable file under
/some/dir/, recursively.

handler.ServeSubtreeZip walks the tree with filepath.WalkDir, ACL-gates
each file by the .zddc chain of its containing directory (per-dir
decision cache, same shape as serveArchiveListing), skips hidden
entries ("." and "_" prefixes — .zddc, _template, _app), and adds a
.zip *file* it encounters as opaque bytes (it does not recurse into it
— that's the navigable-virtual-surface feature, a different thing).
The response is streamed (zip.NewWriter straight onto the
ResponseWriter, Store for already-compressed extensions, Deflate
otherwise), so a fully-ACL-denied or empty subtree just yields a valid
empty zip rather than a 403 (a stream can't change status after the
headers go out; empty leaks no more than 403). HEAD sends the headers
and no body. The dispatch's directory ACL gate still runs first, so a
viewer who can't read the directory gets 403 before the handler.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 12:59:17 -05:00
..
apps feat(zddc): Phase 3 completion — all canonical-folder behaviour now cascade-driven 2026-05-11 15:36:33 -05:00
archive refactor(archive): use shared zddc.ParseTransmittalFolder 2026-05-07 09:14:19 -05:00
auth feat(server): self-issued bearer tokens + --no-auth flag 2026-05-08 07:40:28 -05:00
cache fix(cache): root-escape guard in mirror walker purgeOrphans 2026-05-09 09:10:14 -05:00
config fix(client): plug confused-deputy bind in client mode 2026-05-08 10:03:51 -05:00
fs feat(zddc): Phase 4c — stage strip driven by cascade-declared children 2026-05-11 16:34:56 -05:00
handler feat(zddc): GET /dir/?zip=1 — stream an ACL-filtered .zip of a subtree 2026-05-12 12:59:17 -05:00
jsonschema feat: form-data system v0 (sixth tool + zddc-server endpoints) 2026-05-02 20:12:16 -05:00
listing feat(zddc): Phase 4c — stage strip driven by cascade-declared children 2026-05-11 16:34:56 -05:00
policy feat(zddc): WORM as a cascade key (worm:), retiring hardcoded path predicates 2026-05-12 08:29:11 -05:00
tlsutil feat(server): TLS hardening per NIST SP 800-52 Rev. 2 + HSTS 2026-05-04 17:55:52 -05:00
zddc feat(zddc): dir_tool key — make the slash/no-slash routing convention configurable 2026-05-12 11:46:55 -05:00
zipfs feat(zddc): serve a .zip as a virtual directory (zipfs + dispatch intercept) 2026-05-12 12:17:47 -05:00