Throttle relay token mints per account (todo 507) #13

Merged
extant2000git merged 1 commits from p2-507-relay-throttle into main 2026-11-14 00:19:26 +00:00
Owner

Todo 507. POST /sessions/relay now consumes one unit of a per-account budget (key relay:) in the Postgres rate limiter before minting. Default 30 mints per 300 s, overridable by ENCLAVE_RELAY_MINTS_PER_ACCOUNT and ENCLAVE_RELAY_MINT_WINDOW_SECONDS. Over budget answers 429. The sweep keeps the longest window including this one.

Tests: Tests/EnclaveAccountsKitTests/RelayMintPolicyTests.swift (30 pass, 31st refused, other accounts unaffected, budget returns after the window).

🤖 Generated with Claude Code

Todo 507. POST /sessions/relay now consumes one unit of a per-account budget (key relay:<sub>) in the Postgres rate limiter before minting. Default 30 mints per 300 s, overridable by ENCLAVE_RELAY_MINTS_PER_ACCOUNT and ENCLAVE_RELAY_MINT_WINDOW_SECONDS. Over budget answers 429. The sweep keeps the longest window including this one. Tests: Tests/EnclaveAccountsKitTests/RelayMintPolicyTests.swift (30 pass, 31st refused, other accounts unaffected, budget returns after the window). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
extant2000git added 1 commit 2026-11-14 00:19:10 +00:00
extant2000git merged commit 83e2a6c14a into main 2026-11-14 00:19:26 +00:00
This repo is archived. You cannot comment on pull requests.
No Reviewers
No labels
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: extant2000/flamenet-files#13