pub struct User {
pub username: String,
pub tenant_id: Option<String>,
pub password_hash: String,
pub scram_verifier: Option<ScramVerifier>,
pub role: Role,
pub api_keys: Vec<ApiKey>,
pub created_at: u128,
pub updated_at: u128,
pub enabled: bool,
}Expand description
A registered user in the RedDB auth system.
Stores both the legacy bcrypt-style password_hash (used by
HTTP /auth/login for token minting) and the SCRAM-SHA-256
verifier (used by the v2 wire handshake). Both derive from the
same plaintext at user creation; the SCRAM path never sees
plaintext or the salted password again.
Fields§
§username: String§tenant_id: Option<String>Tenant scope. None = platform-wide (the bootstrap admin and any
platform-level operators); Some("acme") = scoped to a SaaS
tenant. (tenant_id, username) is the unique identity key.
password_hash: String§scram_verifier: Option<ScramVerifier>SCRAM-SHA-256 verifier — { salt, iter, stored_key, server_key }.
Populated alongside password_hash on user creation.
role: Role§api_keys: Vec<ApiKey>§created_at: u128§updated_at: u128§enabled: boolTrait Implementations§
Auto Trait Implementations§
impl Freeze for User
impl RefUnwindSafe for User
impl Send for User
impl Sync for User
impl Unpin for User
impl UnsafeUnpin for User
impl UnwindSafe for User
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request