pub struct VaultConfig {
pub vault_addr: String,
pub token: String,
pub mount_path: String,
pub namespace: Option<String>,
pub verify_tls: bool,
pub timeout: u64,
}Expand description
Configuration for Vault KMS provider.
§Security Considerations
Token Handling:
- The Vault token is stored in memory for the provider’s lifetime
- For production deployments, consider:
- Using short-lived tokens with automatic renewal
- Vault Agent with auto-auth for token management
- AppRole authentication with response wrapping
- Kubernetes auth method in K8s environments
Fields§
§vault_addr: StringVault server address (e.g., https://vault.example.com)
token: StringVault authentication token
mount_path: StringTransit mount path (default: “transit”)
namespace: Option<String>Optional Vault namespace
verify_tls: boolVerify TLS certificates (default: true)
timeout: u64Request timeout in seconds (default: 30)
Implementations§
Source§impl VaultConfig
impl VaultConfig
Sourcepub fn with_mount_path(self, mount_path: String) -> Self
pub fn with_mount_path(self, mount_path: String) -> Self
Set the transit mount path.
Sourcepub fn with_namespace(self, namespace: String) -> Self
pub fn with_namespace(self, namespace: String) -> Self
Set the Vault namespace.
Sourcepub fn with_verify_tls(self, verify_tls: bool) -> Self
pub fn with_verify_tls(self, verify_tls: bool) -> Self
Set TLS verification.
Sourcepub fn with_timeout(self, timeout: u64) -> Self
pub fn with_timeout(self, timeout: u64) -> Self
Set request timeout in seconds.
Trait Implementations§
Source§impl Clone for VaultConfig
impl Clone for VaultConfig
Source§fn clone(&self) -> VaultConfig
fn clone(&self) -> VaultConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for VaultConfig
impl RefUnwindSafe for VaultConfig
impl Send for VaultConfig
impl Sync for VaultConfig
impl Unpin for VaultConfig
impl UnsafeUnpin for VaultConfig
impl UnwindSafe for VaultConfig
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