Expand description
Per-account throttles on password authentication.
Every password attempt reserves a token from the accountโs failed-attempt
bucket before the password is checked, and only a wrong password keeps it,
so concurrent guesses cannot share one token. Only a sign-in by a verified
password debits the account bucket. Both are keyed on the account rather
than the client address, mirroring Synapseโs rc_login.failed_attempts and
rc_login.account; the operator documentation for the
[global.rate_limiting.login] options sets out their costs.
Structsยง
- Limit ๐
- One bucketโs configuration: refill rate per second and burst depth.
- Reservation
- A failed-attempt token reserved for one password attempt.
- Service
- Per-account login throttles.
- Table ๐
- One axisโs token buckets, and where the next prune of them resumes.
Enumsยง
- Axis ๐
- Which bucket table a debit addresses, deciding its full-table policy.
- Hold ๐
- Whether a reservation actually took a token.
Constantsยง
- FULL_
WARNING_ ๐INTERVAL - How often each tableโs full-table warning may repeat while it stays full.
- MAX_
RETRY_ ๐AFTER - The longest
retry_aftera refusal will state, whatever the rate. - PRUNE_
SAMPLE ๐ - How many entries one admission inspects when the table is full.
- RATELIMIT_
MAP_ ๐CAP - Cap on the number of accounts each bucket table holds.
Staticsยง
- ACCOUNT_
FULL_ ๐WARNING - FAILED_
FULL_ ๐WARNING
Functionsยง
- account_
key ๐ - One bucket per account regardless of the case it was typed in, matching the lowercase fallback the password check itself applies.
- debit_
at ๐ - Take one token from an accountโs bucket, refusing when none is left.
- limit_
exceeded ๐ - prune_
sample ๐ - Remove, from the next bounded sample of the table, the buckets that have refilled completely.
- refill ๐
- refund_
at ๐ - Give a held reservationโs token back, never past the burst.
- reserve_
at ๐ - retry_
after ๐ - Seconds until one token is back, rounded up and capped.
Nonewhen it cannot be stated, which the error then simply omits. - warn_
table_ ๐full - Warn that the table for
axiscannot admit another account.
Type Aliasesยง
- Buckets ๐
- Ratelimiter ๐