pub struct VaultSecretsProvider { /* private fields */ }Expand description
Secrets provider that reads from HashiCorp Vault.
Implementations§
Source§impl VaultSecretsProvider
impl VaultSecretsProvider
Sourcepub fn new(config: VaultConfig) -> Self
pub fn new(config: VaultConfig) -> Self
Create a new Vault secrets provider.
Sourcepub async fn authenticate(&self) -> Result<(), String>
pub async fn authenticate(&self) -> Result<(), String>
Authenticate with Vault using configured method.
Sourcepub async fn read_secret(&self, key: &str) -> Result<String, String>
pub async fn read_secret(&self, key: &str) -> Result<String, String>
Read a secret from Vault (KV v2).
Sourcepub async fn load_secrets(&self) -> Result<(), String>
pub async fn load_secrets(&self) -> Result<(), String>
Read all secrets at a path and cache them.
Sourcepub fn get_cached(&self, key: &str) -> Option<String>
pub fn get_cached(&self, key: &str) -> Option<String>
Get a cached secret (synchronous).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for VaultSecretsProvider
impl !RefUnwindSafe for VaultSecretsProvider
impl Send for VaultSecretsProvider
impl Sync for VaultSecretsProvider
impl Unpin for VaultSecretsProvider
impl UnsafeUnpin for VaultSecretsProvider
impl !UnwindSafe for VaultSecretsProvider
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
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>
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