pub struct EnrolWrite {
pub session: AdminSession,
pub user: AdminUser,
pub pending: bool,
}Expand description
A session allowed to set up a factor.
Either an active session – voluntary enrolment, or moving to a new phone
– or a pending_mfa one that exists precisely because the operator has none
and admin.require_mfa is on.
The pending_mfa case requires !user.has_totp(), and that condition is
the whole security of this type. A session that owes a code must never
reach an enrolment route, or the second factor is bypassable by enrolling a
new one over it.
Runs check_origin and check_csrf exactly as AuthenticatedWrite
does: unlike the challenge form, these routes are htmx calls from a page
that was handed a token.
Fields§
§session: AdminSession§user: AdminUser§pending: booltrue when this session is still pending_mfa, so the handler knows to
promote it once the enrolment confirms.
Trait Implementations§
Source§impl Debug for EnrolWrite
impl Debug for EnrolWrite
Source§impl FromRequestParts<AdminState> for EnrolWrite
impl FromRequestParts<AdminState> for EnrolWrite
Source§type Rejection = AdminError
type Rejection = AdminError
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
Source§async fn from_request_parts(
parts: &mut Parts,
state: &AdminState,
) -> Result<Self, Self::Rejection>
async fn from_request_parts( parts: &mut Parts, state: &AdminState, ) -> Result<Self, Self::Rejection>
Perform the extraction.
Auto Trait Implementations§
impl Freeze for EnrolWrite
impl RefUnwindSafe for EnrolWrite
impl Send for EnrolWrite
impl Sync for EnrolWrite
impl Unpin for EnrolWrite
impl UnsafeUnpin for EnrolWrite
impl UnwindSafe for EnrolWrite
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<S, T> FromRequest<S, ViaParts> for T
impl<S, T> FromRequest<S, ViaParts> for T
Source§type Rejection = <T as FromRequestParts<S>>::Rejection
type Rejection = <T as FromRequestParts<S>>::Rejection
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
Source§fn from_request(
req: Request<Body>,
state: &S,
) -> impl Future<Output = Result<T, <T as FromRequest<S, ViaParts>>::Rejection>>
fn from_request( req: Request<Body>, state: &S, ) -> impl Future<Output = Result<T, <T as FromRequest<S, ViaParts>>::Rejection>>
Perform the extraction.
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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