#[non_exhaustive]pub enum DomainLinkageError {
Show 26 variants
InvalidOrigin(String),
InvalidContext(String),
TypPresent(String),
UnexpectedHeaderParameter(String),
UnexpectedClaim(String),
MissingClaim(&'static str),
IdPresent,
MissingContext,
MissingType,
MissingExpirationDate,
SubjectNotDid(Option<String>),
SubjectMismatch {
role: &'static str,
found: String,
subject: Did,
},
InvalidOriginProperty(Option<Value>),
OriginMismatch {
expected: String,
found: String,
},
Validation(ValidationError),
NoCredentialFor(Did),
NoValidCredential(BTreeMap<usize, DomainLinkageError>),
InvalidService {
id: DidUrl,
reason: String,
},
InsecureOrigin(String),
Http {
url: Url,
source: HttpError,
},
NotPublished {
url: Url,
status: u16,
},
HttpStatus {
url: Url,
status: u16,
},
InvalidConfiguration {
url: Url,
source: Error,
},
Resolution(ResolutionError),
TooManyOrigins(usize),
TooManyCredentials(usize),
}domain-linkage only.Expand description
Why a domain linkage credential or configuration did not validate.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidOrigin(String)
An origin is not scheme://host[:port].
InvalidContext(String)
The configuration’s @context is not CONTEXT.
TypPresent(String)
The JWT header has a typ, which the format forbids.
UnexpectedHeaderParameter(String)
The JWT header has a parameter other than alg and kid.
UnexpectedClaim(String)
The JWT payload has a claim other than iss, sub, nbf, exp and vc.
MissingClaim(&'static str)
A required claim is missing: iss, sub, exp or nbf.
IdPresent
The credential has an id, which the format forbids.
MissingContext
The credential’s context does not include CONTEXT.
MissingType
The credential’s type does not include CREDENTIAL_TYPE.
MissingExpirationDate
The credential has no expirationDate.
SubjectNotDid(Option<String>)
credentialSubject.id is missing or not a DID.
SubjectMismatch
The issuer, iss or sub differs from credentialSubject.id.
Fields
InvalidOriginProperty(Option<Value>)
credentialSubject.origin is missing or not one string.
OriginMismatch
credentialSubject.origin is not the origin the resource was fetched from.
Fields
Validation(ValidationError)
The credential did not decode or validate as a credential JWT.
NoCredentialFor(Did)
The configuration holds no JWT credential for the DID.
NoValidCredential(BTreeMap<usize, DomainLinkageError>)
No credential of the configuration validated; the error of each JWT entry by its position.
InvalidService
A LinkedDomains service does not list one or more origins.
InsecureOrigin(String)
The origin is not https, the only scheme the resource is fetched over.
Http
The HttpClient got no response.
NotPublished
The origin publishes no DID configuration: the server answered 404 or 410. A
legitimate state of an origin rather than a failure; see
is_not_published.
HttpStatus
The server answered with a status other than 2xx, 404 and 410.
InvalidConfiguration
The body is not a DID configuration resource: not JSON, not of its shape, or of
another @context.
Resolution(ResolutionError)
The DID did not resolve.
TooManyOrigins(usize)
The origin was not fetched: the DID document lists more origins than the client’s limit, given here.
TooManyCredentials(usize)
The entry was not validated: the configuration holds more JWT entries, or more naming the DID, than the validator’s limit, given here.
Implementations§
Source§impl DomainLinkageError
impl DomainLinkageError
Sourcepub fn is_not_published(&self) -> bool
pub fn is_not_published(&self) -> bool
Whether the origin publishes no DID configuration (NotPublished),
as opposed to a configuration that could not be fetched, read or validated.
Trait Implementations§
Source§impl Debug for DomainLinkageError
impl Debug for DomainLinkageError
Source§impl Display for DomainLinkageError
impl Display for DomainLinkageError
Source§impl Error for DomainLinkageError
impl Error for DomainLinkageError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()