pub struct VaultEntry {Show 25 fields
pub id: String,
pub context_id: String,
pub targets: Vec<SiteTarget>,
pub label: String,
pub secret_kind: SecretKind,
pub tags: Vec<String>,
pub notes: Option<String>,
pub favicon: Option<String>,
pub selectors: Vec<String>,
pub custom_field_names: Vec<String>,
pub attachments: Vec<AttachmentRef>,
pub expires_at: Option<String>,
pub breached_at: Option<String>,
pub password_changed_at: Option<String>,
pub created_at: String,
pub created_by: Option<String>,
pub updated_at: String,
pub updated_by: Option<String>,
pub last_used_at: Option<String>,
pub version: u32,
pub principal_did: Option<String>,
pub status: VaultStatus,
pub archived_at: Option<String>,
pub deleted_at: Option<String>,
pub grace_until: Option<String>,
}Expand description
Public metadata view of a single vault entry. Direct wire-form match for
the VaultEntry $def in the canonical Trust Task shared schema.
Fields§
§id: StringOpaque maintainer-assigned id (ULID recommended).
context_id: StringTrust context (persona) this entry belongs to.
targets: Vec<SiteTarget>Binding targets. A request from any matching target uses this entry.
label: StringUser-facing display name.
secret_kind: SecretKindDiscriminator for the kind of secret bytes; never the bytes themselves.
User-defined tags for filtering.
notes: Option<String>Non-sensitive notes (sensitive notes live inside the secret payload).
favicon: Option<String>Optional icon URI.
selectors: Vec<String>Opaque policy-engine selector strings.
custom_field_names: Vec<String>Names of custom fields (values live in the secret payload).
attachments: Vec<AttachmentRef>References to encrypted blobs (recovery codes, key files, etc.).
expires_at: Option<String>Expected expiry (e.g. OAuth refresh-token expiry, time-limited tokens).
breached_at: Option<String>Set when HIBP (or equivalent) detects this credential in a breach.
password_changed_at: Option<String>Last password rotation timestamp (for password-kind entries).
created_at: StringRFC 3339 creation timestamp.
created_by: Option<String>DID of the consumer that created the entry.
updated_at: StringRFC 3339 last-modification timestamp.
updated_by: Option<String>DID of the consumer that last modified the entry.
last_used_at: Option<String>Most recent use (proxy-login or release).
version: u32Monotonic version for optimistic concurrency + sync seq baseline.
principal_did: Option<String>Cached “principal DID” the entry will act AS for DID-shaped flows.
Mirrors the did field of did-self-issued / didcomm-peer
secrets; absent for kinds without a DID concept. MAINTAINER-DERIVED:
recomputed from the secret at every upsert / rotation; a producer-
supplied value on the wire is ignored. Exposed so consumers can
drive RP-side flows (e.g. an RP page fetching /auth/challenge
keyed on the principal DID before requesting a proxy-login)
without releasing the secret.
status: VaultStatusArchival lifecycle state. Absent on the wire for Active entries
(skip_serializing_if) and defaulted in for records written before
the lifecycle existed. See VaultStatus.
archived_at: Option<String>RFC 3339 timestamp the entry was archived (set iff status == Archived).
deleted_at: Option<String>RFC 3339 timestamp the entry was (soft-)deleted (set iff status == Deleted).
grace_until: Option<String>RFC 3339 deadline after which the sweeper hard-purges a Deleted
entry. Restorable while now < grace_until. Set iff status == Deleted.
Implementations§
Source§impl VaultEntry
impl VaultEntry
Sourcepub fn principal_did_from_secret(secret: &VaultSecret) -> Option<String>
pub fn principal_did_from_secret(secret: &VaultSecret) -> Option<String>
Derive principal_did from a freshly-unsealed VaultSecret. The
maintainer calls this at every upsert + secret rotation; the
resulting value overrides whatever the producer wrote on the
wire (the canonical schema declares the field read-only on the
upsert path).
Sourcepub fn archive(
&mut self,
now: &str,
actor: Option<&str>,
) -> Result<(), LifecycleError>
pub fn archive( &mut self, now: &str, actor: Option<&str>, ) -> Result<(), LifecycleError>
Active → Archived. Refused (NotActive) for any other source state.
Sourcepub fn unarchive(
&mut self,
now: &str,
actor: Option<&str>,
) -> Result<(), LifecycleError>
pub fn unarchive( &mut self, now: &str, actor: Option<&str>, ) -> Result<(), LifecycleError>
Archived → Active. Refused (NotArchived) for any other source state.
Sourcepub fn soft_delete(
&mut self,
now: &str,
grace_until: &str,
actor: Option<&str>,
) -> Result<(), LifecycleError>
pub fn soft_delete( &mut self, now: &str, grace_until: &str, actor: Option<&str>, ) -> Result<(), LifecycleError>
Active|Archived → Deleted (recoverable tombstone). grace_until is
the caller-computed now + grace_days deadline. Refused
(AlreadyDeleted) if the entry is already a tombstone — the operator
should restore or purge instead (a hard delete --force bypasses
this method entirely).
Sourcepub fn restore(
&mut self,
now: &str,
actor: Option<&str>,
) -> Result<(), LifecycleError>
pub fn restore( &mut self, now: &str, actor: Option<&str>, ) -> Result<(), LifecycleError>
Deleted → Active, but only while still inside the grace window.
Refused NotDeleted if the entry isn’t a tombstone, or GraceExpired
if now >= grace_until (the sweeper has purged it or is about to).
The now >= grace_until comparison is lexical over RFC 3339 strings —
consistent with the rest of this module’s timestamp handling (both
stamps are produced by chrono::Utc::now().to_rfc3339()).
Trait Implementations§
Source§impl Clone for VaultEntry
impl Clone for VaultEntry
Source§fn clone(&self) -> VaultEntry
fn clone(&self) -> VaultEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more