pub struct AuthFactor {
pub id: Uuid,
pub user_id: String,
pub panel: String,
pub kind: FactorKind,
pub secret: String,
pub confirmed_at: Option<Timestamp>,
pub last_step: Option<i64>,
pub failures: i64,
pub retry_at: Option<Timestamp>,
pub created_at: Timestamp,
}Expand description
Shipped second-factor record: an account’s authenticator secret, sealed, or the hash of one of its recovery codes, on the panel that enrolled it.
Fields§
§id: Uuid§user_id: StringPanelUser::user_id of the account the factor signs in.
panel: StringThe prefix of the panel that enrolled the factor: the only panel it signs in to.
kind: FactorKind§secret: StringThe authenticator secret, sealed under the router’s cookie key, or the hash of a recovery code, keyed under it.
confirmed_at: Option<Timestamp>When a code proved the authenticator app holds the secret; None while it is being set
up. A recovery code is confirmed when issued.
last_step: Option<i64>The last 30-second step an authenticator code signed in with: a code works once.
failures: i64The wrong codes in a row signing in since the last right one, on the confirmed factor.
retry_at: Option<Timestamp>Until when signing in refuses the confirmed factor’s codes after
failures wrong ones; a recovery code still works.
created_at: TimestampImplementations§
Source§impl AuthFactor
impl AuthFactor
Sourcepub fn fields() -> AuthFactorFields<AuthFactor>
pub fn fields() -> AuthFactorFields<AuthFactor>
Returns a handle used to reference AuthFactor’s fields when building query expressions.
Sourcepub async fn get_by_id(
executor: &mut dyn Executor,
id: impl IntoExpr<FieldExprTarget<Uuid>>,
) -> Result<AuthFactor>
pub async fn get_by_id( executor: &mut dyn Executor, id: impl IntoExpr<FieldExprTarget<Uuid>>, ) -> Result<AuthFactor>
Fetches the single AuthFactor where id matches, erroring if none exists.
Sourcepub fn update_by_id(
id: impl IntoExpr<FieldExprTarget<Uuid>>,
) -> AuthFactorUpdate
pub fn update_by_id( id: impl IntoExpr<FieldExprTarget<Uuid>>, ) -> AuthFactorUpdate
Returns a builder that updates the AuthFactor where id matches.
Sourcepub async fn delete_by_id(
executor: &mut dyn Executor,
id: impl IntoExpr<FieldExprTarget<Uuid>>,
) -> Result<()>
pub async fn delete_by_id( executor: &mut dyn Executor, id: impl IntoExpr<FieldExprTarget<Uuid>>, ) -> Result<()>
Deletes the AuthFactor where id matches.
Sourcepub fn filter_by_id(id: impl IntoExpr<FieldExprTarget<Uuid>>) -> AuthFactorQuery
pub fn filter_by_id(id: impl IntoExpr<FieldExprTarget<Uuid>>) -> AuthFactorQuery
Returns a query selecting the AuthFactor records where id matches.
Sourcepub async fn get_by_user_id(
executor: &mut dyn Executor,
user_id: impl IntoExpr<FieldExprTarget<String>>,
) -> Result<AuthFactor>
pub async fn get_by_user_id( executor: &mut dyn Executor, user_id: impl IntoExpr<FieldExprTarget<String>>, ) -> Result<AuthFactor>
Fetches the single AuthFactor where user_id matches, erroring if none exists.
Sourcepub fn update_by_user_id(
user_id: impl IntoExpr<FieldExprTarget<String>>,
) -> AuthFactorUpdate
pub fn update_by_user_id( user_id: impl IntoExpr<FieldExprTarget<String>>, ) -> AuthFactorUpdate
Returns a builder that updates the AuthFactor where user_id matches.
Sourcepub async fn delete_by_user_id(
executor: &mut dyn Executor,
user_id: impl IntoExpr<FieldExprTarget<String>>,
) -> Result<()>
pub async fn delete_by_user_id( executor: &mut dyn Executor, user_id: impl IntoExpr<FieldExprTarget<String>>, ) -> Result<()>
Deletes the AuthFactor where user_id matches.
Sourcepub fn filter_by_user_id(
user_id: impl IntoExpr<FieldExprTarget<String>>,
) -> AuthFactorQuery
pub fn filter_by_user_id( user_id: impl IntoExpr<FieldExprTarget<String>>, ) -> AuthFactorQuery
Returns a query selecting the AuthFactor records where user_id matches.
Sourcepub fn create() -> AuthFactorCreate
pub fn create() -> AuthFactorCreate
Returns a builder that inserts a new AuthFactor record.
Typically constructed through the toasty::create! macro.
Sourcepub fn create_many() -> CreateMany<AuthFactor>
pub fn create_many() -> CreateMany<AuthFactor>
Returns a builder that inserts multiple AuthFactor records at once.
Sourcepub fn update(&mut self) -> AuthFactorUpdate<&mut Self>
pub fn update(&mut self) -> AuthFactorUpdate<&mut Self>
Returns a builder that updates this AuthFactor record in place.
Source§impl AuthFactor
impl AuthFactor
Sourcepub fn upsert_by_id(
id: impl IntoExpr<FieldExprTarget<Uuid>>,
) -> AuthFactorUpsertById
pub fn upsert_by_id( id: impl IntoExpr<FieldExprTarget<Uuid>>, ) -> AuthFactorUpsertById
Returns a builder that creates AuthFactor or updates the record whose id constraint matches.
The target arguments initialize a new record and remain unchanged when an existing record is updated.
Trait Implementations§
Source§impl Assign<AuthFactor> for AuthFactor
impl Assign<AuthFactor> for AuthFactor
Source§fn into_assignment(self) -> Assignment<AuthFactor>
fn into_assignment(self) -> Assignment<AuthFactor>
Assignment<T> value.Source§fn assign(self, assignments: &mut Assignments, projection: Projection)where
Self: Sized,
fn assign(self, assignments: &mut Assignments, projection: Projection)where
Self: Sized,
Assignments] map at
the specified projection.Source§impl Clone for AuthFactor
impl Clone for AuthFactor
Source§impl Debug for AuthFactor
impl Debug for AuthFactor
Source§impl IntoExpr<AuthFactor> for AuthFactor
impl IntoExpr<AuthFactor> for AuthFactor
Source§impl IntoStatement for &AuthFactor
impl IntoStatement for &AuthFactor
Source§type Returning = AuthFactor
type Returning = AuthFactor
Source§fn into_statement(self) -> Statement<AuthFactor>
fn into_statement(self) -> Statement<AuthFactor>
self and produce the Statement.Source§impl IntoStatement for &mut AuthFactor
impl IntoStatement for &mut AuthFactor
Source§type Returning = AuthFactor
type Returning = AuthFactor
Source§fn into_statement(self) -> Statement<AuthFactor>
fn into_statement(self) -> Statement<AuthFactor>
self and produce the Statement.Source§impl IntoStatement for AuthFactor
impl IntoStatement for AuthFactor
Source§type Returning = AuthFactor
type Returning = AuthFactor
Source§fn into_statement(self) -> Statement<AuthFactor>
fn into_statement(self) -> Statement<AuthFactor>
self and produce the Statement.Source§impl Load for AuthFactor
impl Load for AuthFactor
Source§fn ty() -> Type
fn ty() -> Type
stmt::Type that describes values of this type.Source§fn reload(target: &mut Self, value: Value) -> Result<()>
fn reload(target: &mut Self, value: Value) -> Result<()>
Source§fn ty_relation() -> Type
fn ty_relation() -> Type
stmt::Type used when this type appears as a relation
target. The default delegates to ty().Source§impl Model for AuthFactor
impl Model for AuthFactor
Source§type Query<__T> = AuthFactorQuery<__T>
type Query<__T> = AuthFactorQuery<__T>
Source§type Update<'a> = AuthFactorUpdate<&'a mut AuthFactor>
type Update<'a> = AuthFactorUpdate<&'a mut AuthFactor>
Source§type UpdateQuery = AuthFactorUpdate
type UpdateQuery = AuthFactorUpdate
Source§type PrimaryKey = Uuid
type PrimaryKey = Uuid
Source§type ManyField<__Origin> = AuthFactorListFields<__Origin>
type ManyField<__Origin> = AuthFactorListFields<__Origin>
Source§type OneField<__Origin, __Target> = AuthFactorFields<__Origin, __Target>
type OneField<__Origin, __Target> = AuthFactorFields<__Origin, __Target>
Source§fn new_path<__Origin>(path: Path<__Origin, Self>) -> Self::Path<__Origin>
fn new_path<__Origin>(path: Path<__Origin, Self>) -> Self::Path<__Origin>
Path targeting this model.Source§fn new_many_field<__Origin>(
path: Path<__Origin, List<Self>>,
) -> AuthFactorListFields<__Origin>
fn new_many_field<__Origin>( path: Path<__Origin, List<Self>>, ) -> AuthFactorListFields<__Origin>
ManyField from a path targeting a list
of this model.Source§fn find_by_primary_key(id: Expr<Self::PrimaryKey>) -> Self::Query<List<Self>>
fn find_by_primary_key(id: Expr<Self::PrimaryKey>) -> Self::Query<List<Self>>
Source§fn wrap_query<__T>(stmt: Query<__T>) -> Self::Query<__T>
fn wrap_query<__T>(stmt: Query<__T>) -> Self::Query<__T>
Query in this model’s
query builder, preserving the result shape T. This is the single
constructor generic code uses to build any query shape; callers narrow
at the statement level (.one(), .first()) before wrapping.Source§fn query_one(query: Self::Query<List<Self>>) -> Self::Query<Self>
fn query_one(query: Self::Query<List<Self>>) -> Self::Query<Self>
Source§fn query_first(query: Self::Query<List<Self>>) -> Self::Query<Option<Self>>
fn query_first(query: Self::Query<List<Self>>) -> Self::Query<Option<Self>>
Source§fn new_root_path() -> Self::Path<Self>
fn new_root_path() -> Self::Path<Self>
Source§fn path_model_list() -> Path<List<Self>, List<Self>>
fn path_model_list() -> Path<List<Self>, List<Self>>
Path rooted at a list of this model, used as the root of
has-many relation scopes.Source§fn new_create() -> Self::Create
fn new_create() -> Self::Create
Source§impl ModelCodegen for AuthFactor
impl ModelCodegen for AuthFactor
Source§fn to_relation_expr(&self, fields: &[&str]) -> Expr
fn to_relation_expr(&self, fields: &[&str]) -> Expr
Source§fn new_one_field<__Origin, __Target>(
path: Path<__Origin, __Target>,
) -> Self::OneField<__Origin, __Target>
fn new_one_field<__Origin, __Target>( path: Path<__Origin, __Target>, ) -> Self::OneField<__Origin, __Target>
Source§impl UpdateTarget for &mut AuthFactor
impl UpdateTarget for &mut AuthFactor
Source§type Returning = AuthFactor
type Returning = AuthFactor
Update<R> statement.Source§fn to_update_stmt(&mut self, assignments: Assignments) -> Update<AuthFactor>
fn to_update_stmt(&mut self, assignments: Assignments) -> Update<AuthFactor>
Source§impl ViaTarget for AuthFactor
impl ViaTarget for AuthFactor
Source§type Query = AuthFactorQuery
type Query = AuthFactorQuery
Source§type Path<__Origin> = <AuthFactor as Model>::ManyField<__Origin>
type Path<__Origin> = <AuthFactor as Model>::ManyField<__Origin>
#[has_many(via = …)] field’s accessor returns,
parameterized by the origin model. Mirrors Model::Path for the
via-many case. Read moreSource§fn new_path<__Origin>(
path: Path<__Origin, List<AuthFactor>>,
) -> Self::Path<__Origin>
fn new_path<__Origin>( path: Path<__Origin, List<AuthFactor>>, ) -> Self::Path<__Origin>
Path handle from the typed path reaching this
terminal. A model terminal wraps the path in its chainable ManyField; a
scalar terminal is a leaf, so the path is the handle.Source§fn via_field_ty(singular: Name, path: Path) -> FieldTy
fn via_field_ty(singular: Name, path: Path) -> FieldTy
FieldTy::Via for a #[has_many(via = …)] field whose
terminal element type is Self. Read moreSource§fn make_via_query(assoc: Association<List<AuthFactor>>) -> Self::Query
fn make_via_query(assoc: Association<List<AuthFactor>>) -> Self::Query
Auto Trait Implementations§
impl Freeze for AuthFactor
impl RefUnwindSafe for AuthFactor
impl Send for AuthFactor
impl Sync for AuthFactor
impl Unpin for AuthFactor
impl UnsafeUnpin for AuthFactor
impl UnwindSafe for AuthFactor
Blanket Implementations§
Source§impl<T> Assign<Arc<T>> for Twhere
T: IntoExpr<T>,
impl<T> Assign<Arc<T>> for Twhere
T: IntoExpr<T>,
Source§fn into_assignment(self) -> Assignment<Arc<T>>
fn into_assignment(self) -> Assignment<Arc<T>>
Assignment<T> value.Source§fn assign(self, assignments: &mut Assignments, projection: Projection)where
Self: Sized,
fn assign(self, assignments: &mut Assignments, projection: Projection)where
Self: Sized,
Assignments] map at
the specified projection.Source§impl<T> Assign<Box<T>> for Twhere
T: IntoExpr<T>,
impl<T> Assign<Box<T>> for Twhere
T: IntoExpr<T>,
Source§fn into_assignment(self) -> Assignment<Box<T>>
fn into_assignment(self) -> Assignment<Box<T>>
Assignment<T> value.Source§fn assign(self, assignments: &mut Assignments, projection: Projection)where
Self: Sized,
fn assign(self, assignments: &mut Assignments, projection: Projection)where
Self: Sized,
Assignments] map at
the specified projection.Source§impl<T> Assign<Option<T>> for Twhere
T: IntoExpr<T>,
impl<T> Assign<Option<T>> for Twhere
T: IntoExpr<T>,
Source§fn into_assignment(self) -> Assignment<Option<T>>
fn into_assignment(self) -> Assignment<Option<T>>
Assignment<T> value.Source§fn assign(self, assignments: &mut Assignments, projection: Projection)where
Self: Sized,
fn assign(self, assignments: &mut Assignments, projection: Projection)where
Self: Sized,
Assignments] map at
the specified projection.Source§impl<T> Assign<Rc<T>> for Twhere
T: IntoExpr<T>,
impl<T> Assign<Rc<T>> for Twhere
T: IntoExpr<T>,
Source§fn into_assignment(self) -> Assignment<Rc<T>>
fn into_assignment(self) -> Assignment<Rc<T>>
Assignment<T> value.Source§fn assign(self, assignments: &mut Assignments, projection: Projection)where
Self: Sized,
fn assign(self, assignments: &mut Assignments, projection: Projection)where
Self: Sized,
Assignments] map at
the specified projection.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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> CloneAny for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<M> RelationOneField for Mwhere
M: Model,
impl<M> RelationOneField for Mwhere
M: Model,
Source§type One = <M as Model>::Query<M>
type One = <M as Model>::Query<M>
<Target as Model>::Query<Target>; for nullable impls it is
<Target as Model>::Query<Option<Target>>.Source§type Expr = M
type Expr = M
Self::Target for non-nullable impls and
Option<Self::Target> for nullable impls.Source§fn make_one(
query: <<M as RelationOneField>::Target as Model>::Query<List<<M as RelationOneField>::Target>>,
) -> <M as RelationOneField>::One
fn make_one( query: <<M as RelationOneField>::Target as Model>::Query<List<<M as RelationOneField>::Target>>, ) -> <M as RelationOneField>::One
Query<Model> for non-nullable impls and
Query<Option<Model>> for nullable impls. Read moreSource§fn reload(target: &mut Self, value: Value) -> Result<(), Error>
fn reload(target: &mut Self, value: Value) -> Result<(), Error>
Source§fn belongs_to_relation_field_ty(foreign_key: ForeignKey) -> FieldTy
fn belongs_to_relation_field_ty(foreign_key: ForeignKey) -> FieldTy
FieldTy for a BelongsTo relation field, given the
foreign key resolved from the field’s #[belongs_to(...)] attribute.