namespace DodoSSH.Contracts; /// /// Stable machine-readable error codes returned in the code extension of an /// RFC 9457 ProblemDetails response. /// /// /// These live in Contracts so the client switches on constants rather than parsing prose. /// The values are part of the public contract: add freely, never rename or repurpose. /// public static class ProblemCodes { /// The base URI that every problem type is formed under. public const string TypeBaseUri = "https://dodossh.dev/problems/"; /// A push operation's expectedVersion did not match the stored row. public const string VaultConflict = "vault-conflict"; /// The caller is authenticated but lacks the required permission. public const string Forbidden = "forbidden"; /// The sync cursor was malformed, or failed its integrity tag. public const string InvalidCursor = "invalid-cursor"; /// An Idempotency-Key was reused with a different request body. public const string IdempotencyKeyReuse = "idempotency-key-reuse"; /// The caller has not yet enrolled a public key, so no vault is reachable. public const string EnrollmentRequired = "enrollment-required"; /// Enrollment was attempted for a user who already holds a different current key. public const string AlreadyEnrolled = "already-enrolled"; /// /// The enrollment request was structurally invalid: a bad key length, mismatched KDF /// parameters, a statement that does not describe the caller, or a vault id already in use. /// public const string InvalidEnrollment = "invalid-enrollment"; /// /// The identity-provider token did not bind the supplied keys: a bad signature, the wrong /// subject or audience, an expired token, or a nonce that is not the statement's hash. /// public const string IdentityBindingInvalid = "identity-binding-invalid"; /// /// A device registration was structurally invalid: a public key of the wrong length, a missing or /// oversized wrap, or a blank name. /// /// /// Distinct from even though the rules overlap, because the two are /// different requests and a client showing "your enrollment was rejected" when somebody added a /// fingerprint reader would be describing the wrong thing entirely. /// public const string InvalidDeviceRegistration = "invalid-device-registration"; /// The relay refused the requested target. Never states why, to avoid a probe oracle. public const string RelayTargetRejected = "relay-target-rejected"; /// The relay ticket is expired, already used, or not valid for this node. public const string RelayTicketInvalid = "relay-ticket-invalid"; /// A per-user or per-node relay session limit was reached. public const string RelayLimitReached = "relay-limit-reached"; /// The client is older than the server's minClientVersion. public const string ClientTooOld = "client-too-old"; /// A push batch exceeded the operation count or payload size cap. public const string PushBatchTooLarge = "push-batch-too-large"; }