Enforce per-tenant quotas with aggregate counters #25

Closed
opened 2026-07-01 00:58:13 +00:00 by manlycucumber · 1 comment
manlycucumber commented 2026-07-01 00:58:13 +00:00 (Migrated from github.com)

Problem

Tenants have usage quotas that must be enforced using aggregate counters, not per-request rows, to stay within the privacy and cost model.

Acceptance criteria

  • Each authenticated request increments the tenant's aggregate counter for the current period.
  • Requests over quota return the canonical 429/quota error shape.
  • Counters reset per the configured period boundary.
  • Quota enforcement is covered by tests around the limit boundary.

Notes

Counter updates must be cheap and contention-safe under edge cache misses.

## Problem Tenants have usage quotas that must be enforced using aggregate counters, not per-request rows, to stay within the privacy and cost model. ## Acceptance criteria - [ ] Each authenticated request increments the tenant's aggregate counter for the current period. - [ ] Requests over quota return the canonical 429/quota error shape. - [ ] Counters reset per the configured period boundary. - [ ] Quota enforcement is covered by tests around the limit boundary. ## Notes Counter updates must be cheap and contention-safe under edge cache misses.
manlycucumber commented 2026-07-03 06:11:02 +00:00 (Migrated from github.com)

Delivered in #137 (squash-merged to develop).

Delivered in #137 (squash-merged to `develop`).
Sign in to join this conversation.
No milestone
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
Directorium/Api#25
No description provided.