Skip to main content

AuthCredential

Struct AuthCredential 

Source
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: u16

Wire-level schema version tag.

§kind: AuthKind

Channel family.

§kdf: KdfKind

Hash 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: KdfParams

Cost parameters used for credential_hash.

§expires_tick: Option<Tick>

Optional rotation deadline (S8 anchor).

§bound_tick: Tick

Tick at which the credential was bound.

Implementations§

Source§

impl AuthCredential

Source

pub const DEFAULT_KDF: KdfKind = KdfKind::Argon2id

Runtime default KDF — OWASP 2024 recommendation.

Source

pub const MIN_ARGON2ID_M_COST: u32 = 19_456

Minimum Argon2id memory cost (19 MiB).

Source

pub const MIN_ARGON2ID_T_COST: u32 = 2

Minimum Argon2id iteration count.

Source

pub const MIN_ARGON2ID_P_COST: u32 = 1

Minimum Argon2id parallelism.

Source

pub const MIN_SCRYPT_N_COST: u32

Minimum Scrypt cost N (power-of-two, ≥ 2^15).

Source

pub const MIN_SCRYPT_R_COST: u32 = 8

Minimum Scrypt block-size r.

Source

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

Source§

const TYPE_CODE: u32 = 196610u32

Globally stable dispatch code within the runtime TypeCode registry.
Source§

const SCHEMA_VERSION: u16 = 1u16

Monotone schema version. Bump on field addition (#[serde(default)] paired); field removal / reorder forbidden.
Source§

fn type_code() -> TypeCode

TypeCode wrapper convenience.
Source§

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

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Debug for AuthCredential

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AuthCredential

Source§

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

Source§

fn eq(&self, other: &AuthCredential) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for AuthCredential

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for AuthCredential

Source§

impl StructuralPartialEq for AuthCredential

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,