keystate_core/model/entities/credential.rs
1//! The `Credential` entity.
2
3use serde::{Deserialize, Serialize};
4use serde_json::Value;
5
6/// A credential record owned by a user.
7#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
8pub struct Credential {
9 /// Stable internal identifier — the sort key for deterministic output.
10 #[serde(default)]
11 pub id: String,
12 /// The credential type (e.g. `password`, `otp`) — its identity key.
13 #[serde(default)]
14 pub r#type: String,
15 /// Backend-faithful representation. Credential hashes deliberately
16 /// mirror the backend's stored form; extraction must never mask them.
17 #[serde(default)]
18 pub native: Value,
19}