Struct minerva_rest::fairings::auth::SessionInfo
source · [−]pub struct SessionInfo {
pub info: Session,
pub token: String,
}
Expand description
Struct for session information that can be retrieved for every access to a route that explicitly retrieves it.
Adding a State
containing a SessionInfo
to a route function’s parameters
automatically means that the route will only be accessible by an
authenticated user that passes its authentication info through cookies. If
a SessionInfo
can be retrieved given the cookies information, then the
user is authenticated for using that route.
Fields
info: Session
Session info for the authenticated user.
token: String
Session token for the authenticated user.
Implementations
sourceimpl SessionInfo
impl SessionInfo
Trait Implementations
sourceimpl<'r> FromRequest<'r> for SessionInfo
impl<'r> FromRequest<'r> for SessionInfo
type Error = SessionError
type Error = SessionError
The associated error to be returned if derivation fails.
sourceimpl<'a> OpenApiFromRequest<'a> for SessionInfo
impl<'a> OpenApiFromRequest<'a> for SessionInfo
sourcefn from_request_input(
_gen: &mut OpenApiGenerator,
_name: String,
_required: bool
) -> Result<RequestHeaderInput>
fn from_request_input(
_gen: &mut OpenApiGenerator,
_name: String,
_required: bool
) -> Result<RequestHeaderInput>
Specifies what headers or other parameters are required for this Request Guards to validate
successfully. Read more
fn get_responses(_gen: &mut OpenApiGenerator) -> Result<Responses, OpenApiError>
fn get_responses(_gen: &mut OpenApiGenerator) -> Result<Responses, OpenApiError>
Optionally add responses to the Request Guard.
This can be used for when the request guard could return a “401 Unauthorized”.
Or any other responses, other then one from the default response. Read more
Auto Trait Implementations
impl RefUnwindSafe for SessionInfo
impl Send for SessionInfo
impl Sync for SessionInfo
impl Unpin for SessionInfo
impl UnwindSafe for SessionInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
Converts
self
into a collection.fn mapped<U, F, A>(self, f: F) -> SmallVec<A>where
F: FnMut(T) -> U,
A: Array<Item = U>,
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request