Non-image attachments with allowlist and page attachment UI #61
Labels
No Label
area:auth
area:docs
area:export
area:ops
area:storage
area:supply-chain
auth
backend
blocked
collab
deployment
docs
effort:L
effort:M
effort:S
frontend
plugins
qa
vs-nfd
vs-nfd:blocker
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: stwaidele/dorfteich#61
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Kickoff added general file attachments (PDF, office files, …) with a configurable type allowlist and size limits (ADR 0011).
Scope
Extend uploads (#27): instance-setting MIME/extension allowlist (images always allowed; sensible default list), SVG policy setting (reject | sanitize — implement sanitization with a maintained library),
Content-Disposition: attachmentfor non-image types; page attachments section UI (upload, list with icon/size/uploader, insert-as-link into the document, delete), pond-level file manager for Pond Admins (all files, orphan indicator, usage total).Acceptance criteria
pond_usageTechnical notes
Dependencies
Depends on #27, #52.
Size: ~1.5 days
Conventions: English code/comments, clear human-readable code, no hard-coded UI strings (ADR 0012, add
deanden), permission checks only via the shared guard (docs/architecture/permissions.md). Read the referenced ADRs before starting.#61 verifiziert & abgeschlossen — Nicht-Bild-Anhänge mit Allowlist, SVG-Policy und Dateiverwaltung (Start M6).
Pipeline (
30891f9): alle 7 Kontexte grün — CI (Lint/Typecheck/Test, i18n:check, api-db 184), Auth-e2e-Pack inkl. neuemattachments-Pack, Build → Deploy-Test → Smoke → Promote-Int.Live auf Test + Int (
fixture-admin):201, ausgeliefert mitContent-Disposition: attachment; filename="verify.pdf"+nosniff(nie inline)..exe) →400 upload_type_not_allowed.sanitize) → gespeichertes SVG ohne<script>und ohneonload,<rect>bleibt erhalten.GET /ponds/:id/files→ Dateiliste +storageBytesUsed/storageBytesLimit(Default 1 GiB).Umfang (ADR 0011, security.md §Uploads):
upload.allowedExtensions(Bilder immer erlaubt) +upload.svgPolicy(reject | sanitize, DOMPurify: Skripte/Event-Handler/foreignObject entfernt).Content-Disposition: attachment+nosniff); Raster-Bilder bleiben inline (Page-Embeds). Sanitisiertes SVG wird byte-genau neu verrechnet (pond_usage= Platte).GET /ponds/:id/files(pond_admin, Nutzung+Orphan-Flag),POST/GET /pages/:id/files(Page-Attachments-Sektion). Fehlercodeupload_type_not_allowed(de+en).files-i18n-Namespace.Tests: 6 neue api-db-Fälle (Allowlist accept/reject, renamed-.html-as-.png, SVG sanitize + reject, Page-Listing, Manager-Usage/Orphan, Non-Admin-Deny) + neuer e2e-Pack
attachments.spec.ts(3/3) mit CI-Step.Nebenbefund (nicht #61): Der lokale, nicht in CI laufende Test
image.spec.ts › alt text is editable and persistsschlägt fehl — er wartet auf einen seit #36 (REST-Autosave retired) entfernten „Saved"-Statusindikator. Verifiziert: schlägt auf sauberem HEAD identisch fehl (kein Regress durch #61). Zur separaten Bereinigung notiert.