pub struct MemorySecretStoreProvider { /* private fields */ }Expand description
In-memory secret store for testing.
Stores secrets in a HashMap and returns them on demand. Secrets can be
added at construction time via the builder pattern or at runtime via
set_secret().
§Example
use drasi_lib::secret_store::MemorySecretStoreProvider;
let store = MemorySecretStoreProvider::new()
.with_secret("DB_PASSWORD", "hunter2")
.with_secret("API_KEY", "abc123");Implementations§
Source§impl MemorySecretStoreProvider
impl MemorySecretStoreProvider
Sourcepub fn with_secret(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_secret( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
Add a secret during construction (builder pattern).
Sourcepub async fn set_secret(
&self,
name: impl Into<String>,
value: impl Into<String>,
)
pub async fn set_secret( &self, name: impl Into<String>, value: impl Into<String>, )
Add or update a secret at runtime.
Sourcepub async fn remove_secret(&self, name: &str) -> Option<String>
pub async fn remove_secret(&self, name: &str) -> Option<String>
Remove a secret at runtime.
Trait Implementations§
Source§impl Debug for MemorySecretStoreProvider
impl Debug for MemorySecretStoreProvider
Source§impl Default for MemorySecretStoreProvider
impl Default for MemorySecretStoreProvider
Auto Trait Implementations§
impl !Freeze for MemorySecretStoreProvider
impl !RefUnwindSafe for MemorySecretStoreProvider
impl Send for MemorySecretStoreProvider
impl Sync for MemorySecretStoreProvider
impl Unpin for MemorySecretStoreProvider
impl UnsafeUnpin for MemorySecretStoreProvider
impl UnwindSafe for MemorySecretStoreProvider
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