Skip to main content

SecretRecord

Enum SecretRecord 

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

The secret value.

§sensitivity: Sensitivity

Sensitivity level (spec §3.1).

§revealable: bool

Whether 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.

§environment: String

Environment segment, e.g. prod.

§component: String

Component segment.

§key: String

Key segment.

§description: Option<String>

Optional human description.

§created: String

Creation timestamp (RFC 3339; a Clock trait arrives in a later layer).

§updated: String

Last-update timestamp.

§

Reference

The vault holds only a pointer to an external secret manager.

Fields

§reference: String

Provider URI, e.g. azure-kv://corp-kv/db-url.

§sensitivity: Sensitivity

Sensitivity level.

§revealable: bool

Whether the secret is opted into reveal (see the Literal variant).

§environment: String

Environment segment.

§component: String

Component segment.

§key: String

Key segment.

§description: Option<String>

Optional human description.

§created: String

Creation timestamp.

§updated: String

Last-update timestamp.

§

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: KeyAlgorithm

The 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: String

The OpenSSH-format public key (ssh-ed25519 … / ssh-rsa …). Public material — safe to serialize and display.

§sensitivity: Sensitivity

Sensitivity 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).

§revealable: bool

Whether the secret is opted into reveal (see the Literal variant). A keypair’s private half is never returned to a model regardless; this only governs whether the CLI/UI may show it (I11).

§environment: String

Environment segment.

§component: String

Component segment.

§key: String

Key segment.

§description: Option<String>

Optional human description.

§created: String

Creation timestamp.

§updated: String

Last-update timestamp.

§

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: SecretValue

The base32-decoded shared-secret seed, sealed. Born non-revealable by default (I11), like a high secret.

§algorithm: TotpAlgorithm

The HMAC hash algorithm (SHA1 default). Not a secret.

§digits: u8

Code length in digits (typically 6). Not a secret.

§period: u8

Time step in seconds (typically 30). Not a secret.

§sensitivity: Sensitivity

Sensitivity level. A TOTP enrollment is born high when its environment is prod (I5), like any other secret.

§revealable: bool

Whether the secret is opted into reveal (see the Literal variant). A TOTP seed is never returned to a model regardless; this only governs whether the CLI/UI may show it (I11) — and even the CLI shows the derived code, never the seed.

§environment: String

Environment segment.

§component: String

Component segment.

§key: String

Key segment.

§description: Option<String>

Optional human description.

§created: String

Creation timestamp.

§updated: String

Last-update timestamp.

Implementations§

Source§

impl SecretRecord

Source

pub fn sensitivity(&self) -> Sensitivity

The secret’s sensitivity, regardless of modality.

Source

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.

Source

pub fn environment(&self) -> &str

The environment segment, regardless of modality.

Source

pub fn component(&self) -> &str

The component segment, regardless of modality.

Source

pub fn key(&self) -> &str

The key segment, regardless of modality.

Source

pub fn canonical_path(&self) -> String

The canonical <env>/<component>/<key> path this record files under.

Source

pub fn created(&self) -> &str

The RFC-3339 creation timestamp, regardless of modality.

Source

pub fn updated(&self) -> &str

The RFC-3339 last-updated timestamp, regardless of modality.

Source

pub fn reference(&self) -> Option<&str>

The external reference URI for a Reference record (e.g. azure-kv://vault/name), or None for any other modality. Carries an address, never a value.

Trait Implementations§

Source§

impl Debug for SecretRecord

Source§

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

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

impl<'de> Deserialize<'de> for SecretRecord

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 SecretRecord

Source§

fn eq(&self, other: &SecretRecord) -> 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 SecretRecord

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 StructuralPartialEq for SecretRecord

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> AnyEq for T
where T: Any + PartialEq,

Source§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

Source§

fn as_any(&self) -> &(dyn Any + 'static)

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

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

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V