pub enum TokenError {
Show 24 variants
InvalidSignature {
details: String,
},
UnknownPublicKey,
InvalidKeyFormat {
reason: String,
},
DeserializationError {
reason: String,
},
SerializationError {
reason: String,
},
Base64DecodingError {
reason: String,
},
UnsupportedVersion {
maximum: u32,
minimum: u32,
actual: u32,
},
Expired {
expired_at: i64,
current_time: i64,
block_id: u32,
check_id: u32,
},
DomainMismatch {
expected: String,
provided: Option<String>,
block_id: u32,
check_id: u32,
},
CheckFailed {
block_id: u32,
check_id: u32,
rule: String,
},
IdentityMismatch {
expected: String,
actual: String,
},
HierarchyViolation {
expected: String,
actual: String,
delegatable: bool,
block_id: u32,
check_id: u32,
},
AttenuationFailed {
reason: String,
},
BearerNotAllowed {
reason: String,
},
RightsDenied {
subject: String,
resource: String,
operation: String,
},
ServiceChainFailed {
component: String,
reason: ServiceChainFailure,
},
MultiPartyAttestationMissing {
component: String,
expected_key: String,
},
NoMatchingPolicy {
failed_checks: Vec<CheckFailure>,
},
PolicyMatchedButChecksFailed {
policy_type: String,
policy_index: usize,
failed_checks: Vec<CheckFailure>,
},
ExecutionLimitReached {
reason: String,
},
ExpressionError {
reason: String,
},
InvalidBlockRule {
block_id: u32,
rule: String,
},
Internal(String),
Generic(String),
}Expand description
Detailed error type for hessra-token operations with specific failure information
Variants§
InvalidSignature
Token signature verification failed
UnknownPublicKey
The root public key was not recognized
InvalidKeyFormat
Invalid key format provided
DeserializationError
Token deserialization failed
SerializationError
Token serialization failed
Base64DecodingError
Base64 decoding failed
UnsupportedVersion
Token format version is not supported
Expired
Token has expired
Fields
DomainMismatch
Domain restriction check failed
Fields
CheckFailed
A generic check failed (couldn’t parse semantic meaning)
Fields
IdentityMismatch
Identity/actor mismatch
HierarchyViolation
Identity hierarchy violation (delegation not allowed)
Fields
AttenuationFailed
Token attenuation failed
BearerNotAllowed
Bearer token not allowed in this context
RightsDenied
Authorization rights denied
Fields
ServiceChainFailed
Service chain attestation failed
Fields
reason: ServiceChainFailureSpecific reason for failure
MultiPartyAttestationMissing
Multi-party attestation missing
NoMatchingPolicy
No authorization policy matched and checks failed
Fields
failed_checks: Vec<CheckFailure>List of checks that failed
PolicyMatchedButChecksFailed
Authorization policy matched but checks failed
Fields
failed_checks: Vec<CheckFailure>List of checks that failed
ExecutionLimitReached
Datalog execution limit reached
ExpressionError
Datalog expression evaluation failed
InvalidBlockRule
Invalid block rule
Internal(String)
Internal error
Generic(String)
Generic error with message
Implementations§
Source§impl TokenError
impl TokenError
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if this error is due to token expiration
Sourcepub fn is_domain_mismatch(&self) -> bool
pub fn is_domain_mismatch(&self) -> bool
Check if this error is due to domain mismatch
Sourcepub fn is_identity_mismatch(&self) -> bool
pub fn is_identity_mismatch(&self) -> bool
Check if this error is due to identity mismatch
Sourcepub fn is_rights_denied(&self) -> bool
pub fn is_rights_denied(&self) -> bool
Check if this error is due to authorization rights denial
Sourcepub fn is_service_chain_failure(&self) -> bool
pub fn is_service_chain_failure(&self) -> bool
Check if this error is due to service chain failure
Sourcepub fn is_signature_error(&self) -> bool
pub fn is_signature_error(&self) -> bool
Check if this error is a signature/format error
Sourcepub fn get_expiration_time(&self) -> Option<i64>
pub fn get_expiration_time(&self) -> Option<i64>
Get the expiration time if this is an expiration error
Sourcepub fn get_expected_domain(&self) -> Option<&str>
pub fn get_expected_domain(&self) -> Option<&str>
Get the expected domain if this is a domain mismatch error
Sourcepub fn get_denied_access(&self) -> Option<(&str, &str, &str)>
pub fn get_denied_access(&self) -> Option<(&str, &str, &str)>
Get the missing rights if this is a rights denied error
Sourcepub fn generic<S>(msg: S) -> TokenError
pub fn generic<S>(msg: S) -> TokenError
Create a generic error
Sourcepub fn internal<S>(msg: S) -> TokenError
pub fn internal<S>(msg: S) -> TokenError
Create an internal error
Sourcepub fn invalid_key_format<S>(reason: S) -> TokenError
pub fn invalid_key_format<S>(reason: S) -> TokenError
Create an invalid key format error
Trait Implementations§
Source§impl Clone for TokenError
impl Clone for TokenError
Source§fn clone(&self) -> TokenError
fn clone(&self) -> TokenError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more