module

KemalIdentity::SweepableRateLimiter

A limiter whose counters live in storage that outlasts them.

An attacker can mint a key per guessed login, so a table of counters grows without bound unless something deletes the windows that have elapsed. Sweeper calls this on the application's limiters that include it; the in-memory ones bound themselves and do not.

Instance methods

delete_expired(now : Time) : Int32

Deletes every counter whose window has elapsed by now, returning how many.

Disk reclamation only: an elapsed window is reopened on its next consume regardless.

Source