Skip to main content

Module limits

Module limits 

Source
Expand description

What one account may spend of the proxy: a rate, a number of calls in flight, and a cache of where its targets live.

The target of a proxied call is any https origin a DID document names, and the call leaves from this server’s address. Without a per-account rate, one account can point this server at a third party as fast as it likes, and the blocklist that follows hurts every account. Without caps on calls in flight, accounts calling a service that never answers can hold every one of crate::MAX_CONCURRENT_REQUESTS for super::PROXY_TIMEOUT each. One creator may hold thousands of accounts, so the per-account cap alone does not bound that; the deployment-wide cap does, and the per-tree cap keeps one creator’s accounts from taking all of it.

Structs§

Endpoint 🔒
An endpoint a target’s document named, and under what it was found.
InFlight 🔒
One account’s call held open, released when dropped.
Open 🔒
The proxied calls open now.
ProxyLimits
The per-account bounds on proxied calls, and the cache of targets’ endpoints, for one deployment.
ProxySettings
The bounds on proxied calls, and where an app.bsky.* call with no atproto-proxy goes; see ProxyLimits.

Enums§

Refusal 🔒
Why a proxied call was refused before it left this server.

Constants§

MAX_CACHED_TARGET 🔒
The longest target reference the cache keeps an entry for: the longest DID there is, with room for a service id. A longer one is resolved on every call, so a header’s length does not decide how much the cache holds.
SWEEP_EVERY 🔒
How often buckets that have filled back up are dropped. A full bucket says what an absent one says.

Functions§

lock 🔒
release 🔒
Gives back one of key’s calls, dropping its entry at none.