pub struct AuthCredential {
pub schema_version: u16,
pub kind: AuthKind,
pub kdf: KdfKind,
pub salt: [u8; 16],
pub credential_hash: [u8; 32],
pub kdf_params: KdfParams,
pub expires_tick: Option<Tick>,
pub bound_tick: Tick,
}Expand description
Stored authentication credential — at least one per User (invariant E-user-2). Secret material is a KDF output; no raw password is stored.
Fields§
§schema_version: u16Wire-level schema version tag.
kind: AuthKindChannel family.
kdf: KdfKindHash family. Argon2id is the runtime default.
salt: [u8; 16]Per-credential random salt (16 bytes).
credential_hash: [u8; 32]KDF output: kdf(password, salt, params).
kdf_params: KdfParamsCost parameters used for credential_hash.
expires_tick: Option<Tick>Optional rotation deadline (S8 anchor).
bound_tick: TickTick at which the credential was bound.
Implementations§
Source§impl AuthCredential
impl AuthCredential
Sourcepub const DEFAULT_KDF: KdfKind = KdfKind::Argon2id
pub const DEFAULT_KDF: KdfKind = KdfKind::Argon2id
Runtime default KDF — OWASP 2024 recommendation.
Sourcepub const MIN_ARGON2ID_M_COST: u32 = 19_456
pub const MIN_ARGON2ID_M_COST: u32 = 19_456
Minimum Argon2id memory cost (19 MiB).
Sourcepub const MIN_ARGON2ID_T_COST: u32 = 2
pub const MIN_ARGON2ID_T_COST: u32 = 2
Minimum Argon2id iteration count.
Sourcepub const MIN_ARGON2ID_P_COST: u32 = 1
pub const MIN_ARGON2ID_P_COST: u32 = 1
Minimum Argon2id parallelism.
Sourcepub const MIN_SCRYPT_N_COST: u32
pub const MIN_SCRYPT_N_COST: u32
Minimum Scrypt cost N (power-of-two, ≥ 2^15).
Sourcepub const MIN_SCRYPT_R_COST: u32 = 8
pub const MIN_SCRYPT_R_COST: u32 = 8
Minimum Scrypt block-size r.
Sourcepub fn validate_kdf_params(kdf: KdfKind, p: &KdfParams) -> bool
pub fn validate_kdf_params(kdf: KdfKind, p: &KdfParams) -> bool
L1-compute validator for KDF parameters — rejects weak settings.
Trait Implementations§
Source§impl ArkheComponent for AuthCredential
impl ArkheComponent for AuthCredential
Source§const TYPE_CODE: u32 = 196610u32
const TYPE_CODE: u32 = 196610u32
Globally stable dispatch code within the runtime
TypeCode registry.Source§const SCHEMA_VERSION: u16 = 1u16
const SCHEMA_VERSION: u16 = 1u16
Monotone schema version. Bump on field addition (
#[serde(default)]
paired); field removal / reorder forbidden.Source§fn approx_size(&self) -> usize
fn approx_size(&self) -> usize
Approximate payload size for quota tracking. Default returns
size_of::<Self>(); override for bytes::Bytes-carrying Components.Source§impl Clone for AuthCredential
impl Clone for AuthCredential
Source§fn clone(&self) -> AuthCredential
fn clone(&self) -> AuthCredential
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AuthCredential
impl Debug for AuthCredential
Source§impl<'de> Deserialize<'de> for AuthCredential
impl<'de> Deserialize<'de> for AuthCredential
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for AuthCredential
impl PartialEq for AuthCredential
Source§fn eq(&self, other: &AuthCredential) -> bool
fn eq(&self, other: &AuthCredential) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for AuthCredential
impl Serialize for AuthCredential
impl Eq for AuthCredential
impl StructuralPartialEq for AuthCredential
Auto Trait Implementations§
impl Freeze for AuthCredential
impl RefUnwindSafe for AuthCredential
impl Send for AuthCredential
impl Sync for AuthCredential
impl Unpin for AuthCredential
impl UnsafeUnpin for AuthCredential
impl UnwindSafe for AuthCredential
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