namespace StellaOps.Audit.ReplayToken; /// /// Result of token verification including expiration check. /// public enum ReplayTokenVerificationResult { /// Token is valid and not expired. Valid = 0, /// Token hash does not match the inputs (tampered or different inputs). Invalid = 1, /// Token has expired. Expired = 2 } /// /// Generates deterministic replay tokens for audit and reproducibility. /// public interface IReplayTokenGenerator { /// /// Generates a replay token from the given inputs without expiration (v1.0). /// /// The inputs to hash. /// A deterministic replay token. ReplayToken Generate(ReplayTokenRequest request); /// /// Generates a replay token from the given inputs with expiration (v2.0). /// /// The inputs to hash. /// How long the token is valid. If null, uses ReplayToken.DefaultExpiration. /// A deterministic replay token with expiration. ReplayToken GenerateWithExpiration(ReplayTokenRequest request, TimeSpan? expiration = null); /// /// Verifies that inputs match a previously generated token (does not check expiration). /// bool Verify(ReplayToken token, ReplayTokenRequest request); /// /// Verifies that inputs match a previously generated token and checks expiration. /// /// The token to verify. /// The inputs to verify against. /// The verification result including expiration check. ReplayTokenVerificationResult VerifyWithExpiration(ReplayToken token, ReplayTokenRequest request); }