Skip to main content

AuthorityError

Enum AuthorityError 

Source
pub enum AuthorityError {
Show 16 variants EmptyChain, Digest { index: usize, reason: String, }, NoExpiry { index: usize, }, TooDeep { found: usize, }, NotAuthority { index: usize, found: String, }, RootNotGoverning { root_issuer: String, expected: String, }, BrokenLink { index: usize, named: String, presented: String, }, IssuerNotParentSubject { index: usize, issuer: String, subject: String, }, WidensActions { index: usize, action: String, }, WidensScope { index: usize, scope: String, parent_scope: String, }, OutlivesParent { index: usize, until: DateTime<Utc>, parent_until: DateTime<Utc>, }, ScopeMismatch { granted: String, requested: String, }, ActionNotGranted { action: String, }, NotThePresenter { subject: String, presenter: String, }, NotValidNow { index: usize, at: DateTime<Utc>, }, NoActions { index: usize, },
}
Expand description

Why a chain was refused.

Each variant names a specific way of acquiring authority that was not granted, rather than collapsing into one “invalid” — a verifier’s logs are where an escalation attempt becomes visible.

Variants§

§

EmptyChain

The chain was empty. Nothing to verify.

§

Digest

A link’s digest could not be computed, or one it carries could not be read.

Distinct from AuthorityError::BrokenLink: a digest that cannot be read is not a digest that disagrees, and a verifier that conflated the two would report a malformed chain as a widening one.

Fields

§index: usize
§reason: String
§

NoExpiry

A link carried no validUntil, which a VAC MUST have.

Fields

§index: usize
§

TooDeep

The chain is longer than MAX_CHAIN_DEPTH.

Fields

§found: usize

How many links were presented.

§

NotAuthority

A credential in the chain was not an AuthorityCredential.

Fields

§index: usize

Position in the chain, leaf first.

§found: String

What was found instead.

§

RootNotGoverning

The chain root was not issued by the party governing the scope.

This is the finding that matters most: a chain that does not reach the governing party is a self-issued grant, however well-formed each link is.

Fields

§root_issuer: String

Who actually issued the root.

§expected: String

Who governs the scope being accessed.

A link’s parent did not name the credential presented as its parent.

Fields

§index: usize

Position in the chain, leaf first.

§named: String

The id the link points at.

§presented: String

The id of the credential actually presented as its parent.

§

IssuerNotParentSubject

A link was issued by someone other than its parent’s subject.

Only the party a grant was made to may attenuate it. Without this check a holder could graft an unrelated grant onto their own chain.

Fields

§index: usize

Position in the chain, leaf first.

§issuer: String

Who issued the link.

§subject: String

Who the parent granted to.

§

WidensActions

A link conferred an action its parent did not.

Fields

§index: usize

Position in the chain, leaf first.

§action: String

The action that was added.

§

WidensScope

A link named a different scope from its parent.

Fields

§index: usize

Position in the chain, leaf first.

§scope: String

The link’s scope.

§parent_scope: String

The parent’s scope.

§

OutlivesParent

A link outlived its parent.

Fields

§index: usize

Position in the chain, leaf first.

§until: DateTime<Utc>

The link’s expiry.

§parent_until: DateTime<Utc>

The parent’s expiry.

§

ScopeMismatch

The requested scope is not the one the chain confers on.

Fields

§granted: String

What the chain grants on.

§requested: String

What was asked for.

§

ActionNotGranted

The chain does not confer the requested action.

Fields

§action: String

The action that was requested.

§

NotThePresenter

The leaf grants to somebody other than the party presenting it.

A VAC is evidence that authority was conferred on somebody. It is not evidence that whoever handed it over is that somebody, and a verifier that conflated the two would authorize every captured presentation.

Fields

§subject: String

Who the leaf grants to.

§presenter: String

Who presented it.

§

NotValidNow

A link was outside its validity window at the time of the check.

Fields

§index: usize

Position in the chain, leaf first.

§at: DateTime<Utc>

The instant checked against.

§

NoActions

A link carried an empty actions list.

Fields

§index: usize

Position in the chain, leaf first.

Trait Implementations§

Source§

impl Clone for AuthorityError

Source§

fn clone(&self) -> AuthorityError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AuthorityError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for AuthorityError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for AuthorityError

Source§

impl Error for AuthorityError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for AuthorityError

Source§

fn eq(&self, other: &AuthorityError) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AuthorityError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more