pub enum AuthRefusal {
Missing,
Invalid,
InsufficientScope {
credential: String,
scope: String,
},
NotPermitted {
caller: String,
},
}Expand description
Why the door refused a request before looking at what it asked for.
Variants§
Missing
No Authorization header.
Invalid
An Authorization header that does not present a token this session minted, for any
reason at all.
InsufficientScope
A valid token whose credential does not carry the scope the request needs.
NotPermitted
A genuine formation token issued for another member’s door: caller is a member of this
formation that the roster does not let call this one.
Implementations§
Source§impl AuthRefusal
impl AuthRefusal
pub fn status(&self) -> u16
Sourcepub fn challenge(&self, realm: &str) -> String
pub fn challenge(&self, realm: &str) -> String
The www-authenticate challenge, in RFC 6750’s terms, for a door whose realm is realm.
Sourcepub fn message(&self) -> String
pub fn message(&self) -> String
The body’s message. The 403s name the credential or the member that presented the
token, and go only to its holder; neither 401 says why. not_permitted names nothing
else — not this member, not the one the token was issued for.
Sourcepub fn response(&self, realm: &str) -> ResourceResponse
pub fn response(&self, realm: &str) -> ResourceResponse
The refusal as an HTTP response: status, challenge, and the
{"error": <code>, "message": <sentence>} body the resource plane also answers with.
Trait Implementations§
Source§impl Clone for AuthRefusal
impl Clone for AuthRefusal
Source§impl Debug for AuthRefusal
impl Debug for AuthRefusal
impl Eq for AuthRefusal
Source§impl PartialEq for AuthRefusal
impl PartialEq for AuthRefusal
impl StructuralPartialEq for AuthRefusal
Auto Trait Implementations§
impl Freeze for AuthRefusal
impl RefUnwindSafe for AuthRefusal
impl Send for AuthRefusal
impl Sync for AuthRefusal
impl Unpin for AuthRefusal
impl UnsafeUnpin for AuthRefusal
impl UnwindSafe for AuthRefusal
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more