pub struct DoorAuth { /* private fields */ }Expand description
One session’s door key and the tokens minted with it.
Implementations§
Source§impl DoorAuth
impl DoorAuth
Sourcepub fn mint(authentication: &NetworkAuthentication) -> Result<Self, String>
pub fn mint(authentication: &NetworkAuthentication) -> Result<Self, String>
Generates this session’s key and mints the operator token, holding every scope in
DOOR_SCOPES, and one token per declared credential with exactly its scopes.
The Err is the operating system refusing randomness, and carries no key material.
Sourcepub fn operator_token(&self) -> &DoorToken
pub fn operator_token(&self) -> &DoorToken
The token holding every scope.
Sourcepub fn tokens(&self) -> &[(String, DoorToken)]
pub fn tokens(&self) -> &[(String, DoorToken)]
Every token this session minted, operator first, then the declared credentials by name.
Sourcepub fn verify(
&self,
authorization_headers: &[&str],
) -> Result<DoorGrant, AuthRefusal>
pub fn verify( &self, authorization_headers: &[&str], ) -> Result<DoorGrant, AuthRefusal>
The grant authorization_headers present: every Authorization header value on the
request, as sent.
No header is AuthRefusal::Missing. More than one, a scheme other than Bearer, a token
this key did not seal, and a payload naming a scope outside DOOR_SCOPES are all
AuthRefusal::Invalid, indistinguishably.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DoorAuth
impl RefUnwindSafe for DoorAuth
impl Send for DoorAuth
impl Sync for DoorAuth
impl Unpin for DoorAuth
impl UnsafeUnpin for DoorAuth
impl UnwindSafe for DoorAuth
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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