Skip to main content

VaultEntry

Struct VaultEntry 

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

Opaque maintainer-assigned id (ULID recommended).

§context_id: String

Trust context (persona) this entry belongs to.

§targets: Vec<SiteTarget>

Binding targets. A request from any matching target uses this entry.

§label: String

User-facing display name.

§secret_kind: SecretKind

Discriminator for the kind of secret bytes; never the bytes themselves.

§tags: Vec<String>

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

RFC 3339 creation timestamp.

§created_by: Option<String>

DID of the consumer that created the entry.

§updated_at: String

RFC 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: u32

Monotonic 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: VaultStatus

Archival 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

Source

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

Source

pub fn archive( &mut self, now: &str, actor: Option<&str>, ) -> Result<(), LifecycleError>

Active → Archived. Refused (NotActive) for any other source state.

Source

pub fn unarchive( &mut self, now: &str, actor: Option<&str>, ) -> Result<(), LifecycleError>

Archived → Active. Refused (NotArchived) for any other source state.

Source

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

Source

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

Source§

fn clone(&self) -> VaultEntry

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 VaultEntry

Source§

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

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

impl<'de> Deserialize<'de> for VaultEntry

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 Serialize for VaultEntry

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

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

Source§

fn at<M>(self, metadata: M) -> Meta<T, M>

Wraps self inside a Meta<Self, M> using the given metadata. 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> BorrowStripped for T

Source§

fn stripped(&self) -> &Stripped<T>

Source§

impl<T> BorrowUnordered for T

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> 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<'de, T, C> DeserializeTyped<'de, C> for T
where T: Deserialize<'de>,

Source§

fn deserialize_typed<S>( _: &C, deserializer: S, ) -> Result<T, <S as Deserializer<'de>>::Error>
where S: Deserializer<'de>,

Source§

impl<T, U> DeserializeTypedOwned<T> for U
where U: for<'de> DeserializeTyped<'de, T>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T, C> FromWithContext<T, C> for T

Source§

fn from_with(value: T, _context: &C) -> T

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, U, C> IntoWithContext<U, C> for T
where U: FromWithContext<T, C>,

Source§

fn into_with(self, context: &C) -> U

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

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

Source§

impl<T> ResourceProvider<()> for T

Source§

fn get_resource(&self) -> &()

Returns a reference to the resource of type T.
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> ToOwned for T

Source§

type Owned = T

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, C> TryFromWithContext<U, C> for T
where U: IntoWithContext<T, C>,

Source§

type Error = Infallible

Source§

fn try_from_with( value: U, context: &C, ) -> Result<T, <T as TryFromWithContext<U, C>>::Error>

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, U, C> TryIntoWithContext<U, C> for T
where U: TryFromWithContext<T, C>,

Source§

type Error = <U as TryFromWithContext<T, C>>::Error

Source§

fn try_into_with( self, context: &C, ) -> Result<U, <T as TryIntoWithContext<U, C>>::Error>

Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

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

Source§

fn with<C>(&self, context: C) -> Contextual<&T, C>

Source§

fn into_with<C>(self, context: C) -> Contextual<T, C>
where T: Sized,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more