pub enum VaultSecret {
Password {
username: Option<String>,
password: String,
totp: Option<TotpSeed>,
login_config: Option<PasswordLoginConfig>,
secure_notes: Option<String>,
custom_fields: Vec<CustomField>,
},
Passkey {
credential_id: String,
private_key: String,
algorithm: Option<String>,
rp_id: String,
user_handle: Option<String>,
secure_notes: Option<String>,
},
OauthTokens {
provider: String,
refresh_token: String,
access_token: Option<String>,
access_token_expires_at: Option<String>,
scopes: Vec<String>,
secure_notes: Option<String>,
},
DidSelfIssued {
did: String,
signing_key_id: String,
secure_notes: Option<String>,
},
DidcommPeer {
peer_did: String,
signing_key_id: String,
secure_notes: Option<String>,
},
BearerToken {
token: String,
header_name: Option<String>,
header_prefix: Option<String>,
secure_notes: Option<String>,
},
SshKey {
private_key: String,
public_key: Option<String>,
comment: Option<String>,
passphrase: Option<String>,
secure_notes: Option<String>,
},
Custom {
fields: Vec<CustomField>,
secure_notes: Option<String>,
},
}Expand description
Cleartext secret material. Field-for-field mirror of
vault/_shared/0.2/vault-secret#/$defs/VaultSecret.
Discriminated by kind. This secret rides inside the opaque
authcrypt JWE (vault/upsert’s sealedSecret), so the vault/*/0.2
edge transform cannot reach it — the discriminator is parsed verbatim
here. To accept both a 0.1 producer (kebab did-self-issued) and a
spec-0.2 producer (camelCase didSelfIssued) without a breaking wire
change, each multi-word variant carries a camelCase alias; the
emitted form stays kebab for backwards compatibility (Postel’s law).
This is the fix for the half-completed migration in issue #517 — the
variant fields were camelCased in 76287a5, the discriminator was
not.
Sensitive fields (password, private_key, refresh_token,
secure_notes, token, etc.) MUST be zeroised by handlers as soon as
their use is complete; this enum derives Debug for diagnostic
convenience but production logs MUST NOT format VaultSecret via
{:?} — the strings would leak straight in.
Variants§
Password
Fields
login_config: Option<PasswordLoginConfig>Optional driver config for vault/proxy-login/0.1 against
this entry. When present, the maintainer performs an HTTP
POST against loginConfig.loginUrl with the entry’s
credentials. When absent, proxy-login returns
not_proxyable and the consumer falls back to vault/release
for browser-fill. See vault/_shared/0.1/vault-secret#/$defs/PasswordLoginConfig.
custom_fields: Vec<CustomField>Passkey
Fields
OauthTokens
Fields
DidSelfIssued
DidcommPeer
BearerToken
Fields
SshKey
Fields
Custom
Implementations§
Source§impl VaultSecret
impl VaultSecret
Sourcepub fn kind(&self) -> SecretKind
pub fn kind(&self) -> SecretKind
Returns the SecretKind that matches this variant. The metadata
view’s secret_kind field MUST equal this on every persisted
StoredVaultEntry; an inconsistency is a programming error and
callers can use VaultSecret::matches_kind to assert at the
upsert / release boundary.
Sourcepub fn matches_kind(&self, expected: SecretKind) -> bool
pub fn matches_kind(&self, expected: SecretKind) -> bool
Convenience: assert that this secret’s variant matches expected.
Used by handler code to fail loudly when the metadata view’s
secret_kind disagrees with the unsealed secret’s discriminator.
Trait Implementations§
Source§impl Clone for VaultSecret
impl Clone for VaultSecret
Source§fn clone(&self) -> VaultSecret
fn clone(&self) -> VaultSecret
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VaultSecret
impl Debug for VaultSecret
Source§impl<'de> Deserialize<'de> for VaultSecret
impl<'de> Deserialize<'de> for VaultSecret
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>,
Auto Trait Implementations§
impl Freeze for VaultSecret
impl RefUnwindSafe for VaultSecret
impl Send for VaultSecret
impl Sync for VaultSecret
impl Unpin for VaultSecret
impl UnsafeUnpin for VaultSecret
impl UnwindSafe for VaultSecret
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<'de, T, C> DeserializeTyped<'de, C> for Twhere
T: Deserialize<'de>,
impl<'de, T, C> DeserializeTyped<'de, C> for Twhere
T: Deserialize<'de>,
fn deserialize_typed<S>(
_: &C,
deserializer: S,
) -> Result<T, <S as Deserializer<'de>>::Error>where
S: Deserializer<'de>,
impl<T, U> DeserializeTypedOwned<T> for Uwhere
U: for<'de> DeserializeTyped<'de, T>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ResourceProvider<()> for T
impl<T> ResourceProvider<()> for T
Source§fn get_resource(&self) -> &()
fn get_resource(&self) -> &()
T.