Quota enforcement (507 on write) #14

Closed
opened 2026-07-25 16:25:18 +00:00 by Cordy · 1 comment
Owner

Reporting already ships (GET /api/v1/quota + WebDAV RFC 4331 props, v0.2.1). This is the enforcement half: reject writes that would exceed a configured cap.

  • Global and/or per-user cap (config).
  • Enforce on REST upload, WebDAV PUT, and TUS finalize; return 507 Insufficient Storage (WebDAV) / appropriate JSON error (REST).
  • Feature-detected via storage.Usager; POSIX via statfs, S3 has no bucket-wide capacity so per-user accounting is the realistic path there.

Last remaining functional item in v0.3.

Reporting already ships (`GET /api/v1/quota` + WebDAV RFC 4331 props, v0.2.1). This is the *enforcement* half: reject writes that would exceed a configured cap. - Global and/or per-user cap (config). - Enforce on REST upload, WebDAV PUT, and TUS finalize; return `507 Insufficient Storage` (WebDAV) / appropriate JSON error (REST). - Feature-detected via `storage.Usager`; POSIX via statfs, S3 has no bucket-wide capacity so per-user accounting is the realistic path there. Last remaining functional item in v0.3.
Author
Owner

Shipped in v0.2.5 (PR #34): storage.quota decorator at the write chokepoint — maxFileBytes (any backend, enforced mid-stream), maxTotalBytes/reserveBytes (Usager-backed), storage.ErrQuotaExceeded → 507 on WebDAV, JSON error on REST/TUS. Issue was left open by mistake; closing retroactively.

Shipped in **v0.2.5** (PR #34): `storage.quota` decorator at the write chokepoint — `maxFileBytes` (any backend, enforced mid-stream), `maxTotalBytes`/`reserveBytes` (Usager-backed), `storage.ErrQuotaExceeded` → 507 on WebDAV, JSON error on REST/TUS. Issue was left open by mistake; closing retroactively.
Cordy closed this issue 2026-07-26 14:55:35 +00:00
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#14
No description provided.