KemalIdentity::Verdict
Whether an attempt may proceed, when to come back if not, and whether the limiter could answer at all.
Three states, because two of them are not the same "no"
A limiter over shared storage has a third thing to say: the store did not answer. Without
a way to say it, an adapter whose Redis is down can only lie — report allow and turn rate
limiting off under exactly the conditions an attacker can provoke, report deny and take
the login endpoint down for everybody, or raise and become a 500. All three are decisions
the adapter has no business making on the application's behalf
(blueprints/0023-rate-limiter-store-failure.md).
Constructors
Instance methods
Whether the attempt may proceed.
False when the store was unavailable. Code that only ever asks this question therefore
fails closed on an outage rather than open, which is the safe direction for the one to
forget. Ask #unavailable? to tell the two apart.
How long until the caller may try again. Set only on a denial.
Telling an honest client when to return is worth more than the little it reveals: the attacker already knows they are being throttled — that is what being throttled means — while a legitimate user staring at "try again later" has no idea whether to wait a second or an hour.