pub enum UcanError {
InvalidToken,
InvalidSignature,
InvalidPublicKey,
Expired,
NotYetValid,
NoToken,
}Expand description
Errors from token creation, decoding, or verification.
Variants§
InvalidToken
Not a well-formed header.payload.signature triple, or a part
isn’t valid base64url/JSON — mirrors macula_ucan_nif’s
{error, invalid_token}.
InvalidSignature
The token parsed fine but its signature does not verify against
the given public key — mirrors {error, invalid_signature}.
InvalidPublicKey
The supplied public key isn’t a 32-byte Ed25519 key — mirrors
{error, invalid_public_key}.
Expired
The token’s exp claim is in the past — mirrors {error, expired}.
NotYetValid
The token’s nbf claim is in the future — mirrors
{error, not_yet_valid}.
NoToken
A UCAN-gated procedure was called with no token at all — mirrors
macula_station_link.erl’s check_ucan(<<>>, _) -> unauthorized
clause (an empty/absent token is refused before ever attempting to
verify anything).
Trait Implementations§
Source§impl Error for UcanError
impl Error for UcanError
1.30.0 · 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()