Construct with explicit bounds and an optional injectable clock (used by tests to drive TTL expiry deterministically). A null clock uses MonoTime.currTime.
Number of live pending authorizations (test/diagnostic use).
Record the client's authorization details under the proxy state.
Consume and return the details for proxyState, setting found.
Maximum number of live pending authorizations. When reached on put, the oldest entries are evicted so a flood cannot exhaust memory inside the TTL.
Lifetime of a pending authorization (authorize -> consent -> callback). An abandoned or un-consented flow is swept after this elapses.
A thread-safe in-memory store mapping a proxy state to the client's pending-authorization details. Entries are consumed (single use) on lookup so a relayed callback cannot be replayed.
The store is bounded so the unauthenticated /authorize route cannot grow process memory without limit: each entry carries an insertion timestamp, and every put/take sweeps entries older than the authorization-flow TTL and caps the live entry count, evicting the oldest by insertion time when the cap is reached. The clock is injectable so the bounds are unit-testable.