pub struct VaultResolver { /* private fields */ }Expand description
Resolves secrets from HashiCorp Vault
Mode is auto-negotiated based on environment:
- If
VAULT_TOKENandVAULT_ADDRare set → HTTP mode - Otherwise → CLI mode (uses
vaultCLI)
The source field in SecretSpec can be:
- A JSON-encoded
VaultSecretConfig
Implementations§
Source§impl VaultResolver
impl VaultResolver
Sourcepub fn new() -> Result<Self, SecretError>
pub fn new() -> Result<Self, SecretError>
Create a new Vault resolver with auto-detected mode
If Vault credentials are available in environment, uses HTTP mode. Otherwise, CLI mode will be used.
§Errors
Returns an error if the Vault HTTP client cannot be initialized.
Trait Implementations§
Source§impl Debug for VaultResolver
impl Debug for VaultResolver
Source§impl SecretResolver for VaultResolver
impl SecretResolver for VaultResolver
Source§fn provider_name(&self) -> &'static str
fn provider_name(&self) -> &'static str
Get the provider name for this resolver. Read more
Source§fn resolve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
spec: &'life2 SecretSpec,
) -> Pin<Box<dyn Future<Output = Result<String, SecretError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn resolve<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
spec: &'life2 SecretSpec,
) -> Pin<Box<dyn Future<Output = Result<String, SecretError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Resolve a single secret by name and spec. Read more
Source§fn resolve_secure<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
spec: &'life2 SecretSpec,
) -> Pin<Box<dyn Future<Output = Result<SecureSecret, SecretError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn resolve_secure<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
spec: &'life2 SecretSpec,
) -> Pin<Box<dyn Future<Output = Result<SecureSecret, SecretError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Resolve a single secret returning a secure value. Read more
Source§fn resolve_all<'life0, 'life1, 'async_trait>(
&'life0 self,
secrets: &'life1 HashMap<String, SecretSpec>,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, String>, SecretError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn resolve_all<'life0, 'life1, 'async_trait>(
&'life0 self,
secrets: &'life1 HashMap<String, SecretSpec>,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, String>, SecretError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Resolve multiple secrets at once (legacy sequential API). Read more
Source§fn resolve_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
secrets: &'life1 HashMap<String, SecretSpec>,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, SecureSecret>, SecretError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn resolve_batch<'life0, 'life1, 'async_trait>(
&'life0 self,
secrets: &'life1 HashMap<String, SecretSpec>,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, SecureSecret>, SecretError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Resolve multiple secrets in batch with concurrent execution. Read more
Source§fn supports_native_batch(&self) -> bool
fn supports_native_batch(&self) -> bool
Check if this resolver supports native batch resolution. Read more
Auto Trait Implementations§
impl Freeze for VaultResolver
impl !RefUnwindSafe for VaultResolver
impl Send for VaultResolver
impl Sync for VaultResolver
impl Unpin for VaultResolver
impl !UnwindSafe for VaultResolver
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