namespace ZB.MOM.WW.MxGateway.Server.Security.Authorization;

/// <summary>
/// Outcome of an <see cref="ApiKeyFailureLimiter"/> admission check for one authentication attempt.
/// </summary>
public enum ApiKeyThrottleDecision
{
    /// <summary>No layer is over its limit; the request proceeds to verification normally.</summary>
    Allowed = 0,

    /// <summary>
    /// At least one layer is over its limit, but this request took the probe slot for the current
    /// interval and proceeds to verification. A success resets every layer it passed.
    /// </summary>
    ProbeAdmitted = 1,

    /// <summary>
    /// The <c>(transport peer, key id)</c> partition is over its limit and no probe slot is
    /// available; the request is rejected before the verification store read.
    /// </summary>
    ThrottledByPeer = 2,

    /// <summary>
    /// The cross-peer aggregate for the presented key id is over its limit and no probe slot is
    /// available; the request is rejected before the verification store read.
    /// </summary>
    ThrottledByAggregate = 3,
}
