pub struct SecretResolver { /* private fields */ }Expand description
Resolves SecretRef values at startup and caches results in memory.
Never writes secrets to disk. Detects whether stdin is a TTY to gate
the prompt: backend.
Implementations§
Source§impl SecretResolver
impl SecretResolver
pub fn new() -> Self
pub fn is_interactive(&self) -> bool
Sourcepub fn resolve(
&self,
field: &str,
secret_ref: &SecretRef,
) -> Result<String, SecretError>
pub fn resolve( &self, field: &str, secret_ref: &SecretRef, ) -> Result<String, SecretError>
Resolve a single secret by config field name.
Sourcepub fn store_keyring(key: &str, value: &str) -> Result<(), SecretError>
pub fn store_keyring(key: &str, value: &str) -> Result<(), SecretError>
Store a secret in the Linux kernel keyring for restart persistence.
Sourcepub fn resolve_config(
&self,
config: &Config,
) -> Result<ResolvedSecrets, SecretError>
pub fn resolve_config( &self, config: &Config, ) -> Result<ResolvedSecrets, SecretError>
Resolve all configured secrets and return a bundle.
Sourcepub fn persist_to_keyring(&self)
pub fn persist_to_keyring(&self)
Persist all resolved secrets to the kernel keyring.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SecretResolver
impl !RefUnwindSafe for SecretResolver
impl Send for SecretResolver
impl Sync for SecretResolver
impl Unpin for SecretResolver
impl UnsafeUnpin for SecretResolver
impl !UnwindSafe for SecretResolver
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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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