pub struct SecretStore { /* private fields */ }Expand description
In-process store of sealed secrets.
Constructed by the host at Uni instance startup; populated from
secure config (KMS, env vars, secrets manager). Plugins acquire
handles via SecretStore::acquire; capability-gated host imports
resolve handles back to bytes via SecretStore::unseal_for_host_use
which is itself private to the framework’s host-import implementations.
Implementations§
Source§impl SecretStore
impl SecretStore
Sourcepub fn seal(&self, name: impl Into<String>, bytes: Vec<u8>)
pub fn seal(&self, name: impl Into<String>, bytes: Vec<u8>)
Seal bytes under name, replacing any previous value.
Host-side only; plugin code never seals secrets.
Sourcepub fn unseal_for_host_use(&self, h: SecretHandle) -> Result<Vec<u8>, FnError>
pub fn unseal_for_host_use(&self, h: SecretHandle) -> Result<Vec<u8>, FnError>
Host-only: resolve a handle to its underlying bytes.
Used by host-import implementations (e.g., http_get_with_secret)
to attach the secret to an outbound HTTP header before invoking
the actual network call. This must not be exposed to plugin
code — it’s pub within the crate but not re-exported through
the WIT binding layer.
§Errors
Returns FnError with code 0xA01 if the handle is invalid
(e.g., from a different store, or revoked).
Sourcepub fn revoke(&self, h: SecretHandle)
pub fn revoke(&self, h: SecretHandle)
Revoke a handle (e.g., on plugin reload).
Trait Implementations§
Source§impl Debug for SecretStore
impl Debug for SecretStore
Auto Trait Implementations§
impl !Freeze for SecretStore
impl !RefUnwindSafe for SecretStore
impl Send for SecretStore
impl Sync for SecretStore
impl Unpin for SecretStore
impl UnsafeUnpin for SecretStore
impl UnwindSafe for SecretStore
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more