pub enum SecretRecord {
Literal {
value: SecretValue,
sensitivity: Sensitivity,
revealable: bool,
environment: String,
component: String,
key: String,
description: Option<String>,
created: String,
updated: String,
},
Reference {
reference: String,
sensitivity: Sensitivity,
revealable: bool,
environment: String,
component: String,
key: String,
description: Option<String>,
created: String,
updated: String,
},
Keypair {
algorithm: KeyAlgorithm,
private: Option<SecretValue>,
public: String,
sensitivity: Sensitivity,
revealable: bool,
environment: String,
component: String,
key: String,
description: Option<String>,
created: String,
updated: String,
},
Totp {
seed: SecretValue,
algorithm: TotpAlgorithm,
digits: u8,
period: u8,
sensitivity: Sensitivity,
revealable: bool,
environment: String,
component: String,
key: String,
description: Option<String>,
created: String,
updated: String,
},
}Expand description
A single secret record, in one of four modalities. Internally tagged by
mode to mirror the spec §10.1 on-the-wire shape.
Debug is safe: the only secret-bearing fields are value (literal),
private (keypair), and seed (totp) — all SecretValues whose own
Debug is redacted (I12). The public half of a keypair and the TOTP
parameters (algorithm/digits/period) are not secrets.
Variants§
Literal
The value lives (encrypted) in the vault.
Fields
value: SecretValueThe secret value.
sensitivity: SensitivitySensitivity level (spec §3.1).
revealable: boolWhether the secret is opted into reveal (the §3.1 “revealable” flag).
Sourced into crate::AccessRequest::revealable so the policy
funnel (I11) reads it from the stored secret, never from caller
intent. Defaults to false so pre-L9 vaults (and any record that
never opted in) are non-revealable — the safe default.
Reference
The vault holds only a pointer to an external secret manager.
Fields
sensitivity: SensitivitySensitivity level.
Keypair
An asymmetric keypair (KOV-12). The private half (when present) is a
sealed SecretValue custodied exactly like a literal — never exported,
used only through operations (sign / decrypt / ssh-add), mirroring
injection. The public half is not a secret and is shown freely. A
private: None record is a public-only entry: a peer’s/recipient’s
public key for encrypt/verify.
Fields
algorithm: KeyAlgorithmThe key algorithm (ed25519 or RSA).
private: Option<SecretValue>The OpenSSH-format private key, sealed. None for a public-only
entry. Born non-revealable by default (I11), like a high secret.
public: StringThe OpenSSH-format public key (ssh-ed25519 … / ssh-rsa …). Public
material — safe to serialize and display.
sensitivity: SensitivitySensitivity level. A keypair with a private half is born high
when its environment is prod (I5), like any other secret; a
public-only entry is typically low (it holds no secret).
Totp
A TOTP enrollment (KOV-11). The seed (the shared secret) is a sealed
SecretValue custodied exactly like a literal — never exported, used
only through deriving a short-lived RFC-6238 code (kovra code),
mirroring how a keypair’s private half is used only through sign/decrypt.
The seed is never returned to a model (I11/I14) regardless of the
revealable flag; only the derived code is produced, on demand.
Fields
seed: SecretValueThe base32-decoded shared-secret seed, sealed. Born non-revealable by
default (I11), like a high secret.
algorithm: TotpAlgorithmThe HMAC hash algorithm (SHA1 default). Not a secret.
sensitivity: SensitivitySensitivity level. A TOTP enrollment is born high when its
environment is prod (I5), like any other secret.
Implementations§
Source§impl SecretRecord
impl SecretRecord
Sourcepub fn sensitivity(&self) -> Sensitivity
pub fn sensitivity(&self) -> Sensitivity
The secret’s sensitivity, regardless of modality.
Sourcepub fn revealable(&self) -> bool
pub fn revealable(&self) -> bool
Whether the secret is opted into reveal (the §3.1 “revealable” flag).
Faces that build a crate::AccessRequest read it from here so the
I11 reveal gate is sourced from the stored record, never caller intent.
Sourcepub fn environment(&self) -> &str
pub fn environment(&self) -> &str
The environment segment, regardless of modality.
Sourcepub fn canonical_path(&self) -> String
pub fn canonical_path(&self) -> String
The canonical <env>/<component>/<key> path this record files under.
Trait Implementations§
Source§impl Debug for SecretRecord
impl Debug for SecretRecord
Source§impl<'de> Deserialize<'de> for SecretRecord
impl<'de> Deserialize<'de> for SecretRecord
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>,
Source§impl PartialEq for SecretRecord
impl PartialEq for SecretRecord
Source§fn eq(&self, other: &SecretRecord) -> bool
fn eq(&self, other: &SecretRecord) -> bool
self and other values to be equal, and is used by ==.