RateLimit
Fixed-window permit budgets per caller, keyed by remote host.
Three budgets are kept, so that unauthenticated traffic cannot spend what a legitimate caller sharing the same host (a NAT, a proxy that does not forward the client address) needs:
Attempts (attemptPermits, generous): every request, counted before authentication. It exists only to bound the work an anonymous flood can cause (the authenticator runs for each request that gets past it). It is deliberately far above permits.
Failed authentications (failedAuthPermits, strict): charged only when the credential is refused. When it is exhausted, a refused credential is answered 429 instead of 401. A caller presenting a valid credential is never affected by this budget.
Admitted requests (permits): charged only to requests that passed authentication (or needed none). A flood of bad credentials therefore cannot use up the budget of the legitimate caller behind the same host.
Each budget tracks at most maxTrackedCallers callers. When the table is full, expired windows are dropped first; if every tracked caller is still inside its window, callers that are not tracked share a single overflow window per budget. Tracked callers keep their budgets, so spraying distinct caller keys cannot reset anyone's spend; the cost of that is that, while such a spray lasts, untracked callers compete for the overflow window.
This bounds one caller; HostTelemetry's admission limit bounds the server as a whole. Behind a proxy every request shares one remote host, so configure the limit at the proxy instead of here unless the proxy preserves the client address.