mirror of
https://github.com/runbear-io/beardrive.git
synced 2026-08-25 08:08:08 +02:00
The quota counterpart of AuthProvider: CheckWrite(org, addedBytes) runs before every write path (browser upload via server or presign/commit, the device-sync store proxy's sign and put), RecordUsage after success, and CheckSeat before an invite adds a member. Denials surface as 403. The open-source server ships only UnlimitedQuota and a nil provider means unlimited — zero behavior change here; a managed deployment enforces plans by swapping the provider. Unit test asserts the hooks fire with the correct org and byte counts and that denials block without recording usage. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R7Q9ZKSZRTdvrSJkYLUmYs