Quota foundation: defaults, overrides, and resolution service #22
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
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: stwaidele/dorfteich#22
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
Quota enforcement starts with pond creation (additional-ponds limit) and grows with uploads and membership; the three-level ladder (instance → user → pond) is a kickoff decision.
Scope
Implement
quota_overrides+pond_usagemodels, instance-default quota keys inInstanceSettingsService(editors_per_pond=5,readers_per_pond=50,additional_ponds=0,storage_bytes=1GiB,max_file_bytes=25MiB), and aQuotaServicewithgetEffective(quotaKey, {userId, pondId})(pond override → user override → instance default) andcheckAndConsume/releasehelpers updatingpond_usagetransactionally. Enforceadditional_pondsin pond creation (#21). Admin endpoints for overrides come in M5 (#58).Acceptance criteria
additional_pondsTechnical notes
Dependencies
Depends on #19, #21.
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.Implemented in
64928f0, pipeline fully green.Verification against acceptance criteria:
0as a valid override (pond → user → instance)additional_pondsyields 403quota_exceededwithdetails={quotaKey, limit}; message localized de/en with the limit interpolated — covered by e2e (default 0 blocks, override 1 allows exactly one)checkAndConsume(600)against a 1000-byte limit — exactly one wins (pg_advisory_xact_lock inside the guarded transaction);releasefloors at 0additional_ponds(count filters type=SHARED, deletedAt null)Note: instance default for additional_ponds is 0 by design — the seed grants fixtures an override of 100 so dev/stage flows remain exercisable. Admin endpoints for overrides land in M5 (#58).