pub enum UcanVerifyError {
Parse(UcanParseError),
BadSignature {
cid: String,
},
MalformedSignature {
cid: String,
reason: String,
},
MalformedDidKey {
field: &'static str,
reason: String,
},
Expired {
cid: String,
exp: i64,
now: i64,
},
WideningAttenuation {
cid: String,
parent: Vec<String>,
child: Vec<String>,
},
ChainBroken {
parent_cid: String,
parent_aud: String,
child_cid: String,
child_iss: String,
},
AudienceMismatch {
leaf_aud: String,
expected: String,
},
ChainTooDeep {
depth: u8,
max: u8,
},
Revoked {
cid: String,
},
MultiParentNotSupported {
cid: String,
n_parents: usize,
},
}Expand description
Errors returned by crate::ucan::verify_jwt / verify_tokens.
Parse-stage failures bubble up as Parse(_) → wire code
ERR_UCAN_INVALID = 1010. Other verify-stage failures map to:
| Variant | Wire code |
|---|---|
Parse, BadSignature, WideningAttenuation, MultiParentNotSupported, MalformedDidKey, MalformedSignature, ChainBroken | 1010 ERR_UCAN_INVALID |
Expired | 1011 ERR_UCAN_EXPIRED |
ChainTooDeep | 1012 ERR_DELEGATION_TOO_DEEP |
AudienceMismatch | 1013 ERR_AUDIENCE_MISMATCH |
Revoked | 1010 ERR_UCAN_INVALID (with revoked-cid hint) |
All retryable: false (deterministic).
Variants§
Parse(UcanParseError)
Underlying parse failure (any UcanParseError variant).
BadSignature
Ed25519 signature verification failed for the named token CID.
MalformedSignature
Signature segment failed to base64url-decode or had wrong length.
MalformedDidKey
did:key:z... failed to decode (bad multibase, wrong multicodec
prefix, or wrong key length).
Expired
A link’s exp <= now(). Distinct from Parse because the token
was well-formed — it just lapsed.
WideningAttenuation
Child claims caps the parent did not grant.
ChainBroken
Link N’s iss doesn’t match link N-1’s aud. The chain is broken.
AudienceMismatch
The leaf’s aud doesn’t match the configured expected audience.
ChainTooDeep
The chain exceeds the configured max_chain_depth.
Revoked
A link’s CID was in the revocation store.
MultiParentNotSupported
prf field has more than one parent. UCAN v1.0 spec allows
multi-parent; SP-capability-v2 v1 supports single-chain only.
Trait Implementations§
Source§impl Debug for UcanVerifyError
impl Debug for UcanVerifyError
Source§impl Display for UcanVerifyError
impl Display for UcanVerifyError
Source§impl Error for UcanVerifyError
impl Error for UcanVerifyError
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()