namespace OpenWaf.Domain.Policy;
///
/// What the edge does with a source that asked more often than the budget
/// allows (OPEN-56).
///
/// A separate switch from on purpose. Volume is a
/// different claim from a run of refusals: the streak reads what the origin
/// answered, the rate policy reads how often the origin was asked. An operator
/// who has been running the streak in Enforce for a month and wants to find out
/// what a volume limit would have done must be able to switch one on without
/// touching the other, and the reverse.
///
/// Off is the default. A limit nobody wrote is a defence nobody asked for, and
/// a false positive here locks out a whole office behind one address.
///
public enum RateMode
{
/// Nothing is counted. The answer to every request is exactly what
/// it was before the feature existed.
Off = 0,
/// Counted, and said so — one alert per source per window — but
/// nothing is refused. This is how an operator learns what the budget would
/// have cut before it cuts anything.
Observe = 1,
/// The request that crosses the budget is refused for the rest of
/// the window, and the source also gets an engine ban so the stop is shared
/// with the other edges and survives a restart.
Enforce = 2
}