pub struct Identity {
pub user_id: i64,
pub email: String,
pub role: Role,
pub is_active: bool,
pub is_demo: bool,
pub demo_label: Option<String>,
pub must_change_password: bool,
}Expand description
The identity attached to a request by the auth middleware. Kept cheap to clone because we pass it into handler bodies.
Fields§
§user_id: i64§email: String§role: Role§is_active: bool§is_demo: boolWhether this user was seeded by a demo-fixture flow. Drives the
red banner in the admin UI; remains FALSE for users created via
the normal create_user path.
demo_label: Option<String>§must_change_password: boolMirrors the rustio_users.must_change_password column added in
R1’s recovery migration. When TRUE, R2’s login_guard
(commit #13) redirects every authenticated request to
/admin/must-change-password until the user completes the
forced rotation, except for a small whitelist
(/admin/must-change-password, /admin/logout,
/admin/account/sessions). R1 emissions don’t read this
field; this commit only loads it from the SQL paths so commits
#9 / #13 can act on it.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Identity
impl RefUnwindSafe for Identity
impl Send for Identity
impl Sync for Identity
impl Unpin for Identity
impl UnsafeUnpin for Identity
impl UnwindSafe for Identity
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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