Skip to main content

ic_auth_protocol_types/
admission.rs

1//! Bounded admission diagnostics, never evidence that a proof is authentic.
2use serde::{Deserialize, Serialize};
3
4/// A receiver refusal. Only `NotYetValid` identifies a future-start retry hint;
5/// it grants no clock grace, new issuance, deadline extension or authorization.
6/// The caller owns bounded retries of the same credential and login generation.
7#[derive(Clone, Copy, Debug, Deserialize, Serialize, Eq, PartialEq)]
8pub enum AdmissionRefusal {
9    /// The claimed validity window has not started; authenticity is not implied.
10    NotYetValid,
11    /// The credential or session validity window has ended.
12    Expired,
13    /// Encoding, identity binding, claims or cryptographic verification failed.
14    InvalidCredential,
15    /// Current protected authority is disabled, stale or unavailable.
16    AuthorityUnavailable,
17    /// The credential predates the receiver's protected reset boundary.
18    BeforeReset,
19    /// The requested scopes are not admitted for this session.
20    ScopeRejected,
21    /// Retained replay state conflicts with this admission.
22    ReplayConflict,
23    /// A retained revocation denies this login.
24    Revoked,
25    /// A bounded record or byte capacity cannot accommodate admission.
26    Capacity,
27    /// The receiver's verification work budget is exhausted.
28    Throttled,
29    /// Admission cannot complete because of local policy, clock or storage state.
30    Unavailable,
31}
32/// Proof-free session-read refusal; detailed host diagnostics are not transported.
33#[derive(Clone, Copy, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
34pub enum SessionReadRefusal {
35    /// No usable session remains for the authenticated caller.
36    MissingOrExpired,
37    /// The session's authority is disabled or no longer current.
38    AuthorityUnavailable,
39    /// The session does not contain the required scope.
40    ScopeRejected,
41    /// Retained revocation state denies the login.
42    Revoked,
43    /// Local state prevents a reliable session decision.
44    Unavailable,
45}