pub struct FileProvider { /* private fields */ }Expand description
Secret provider that reads from files.
Implementations§
Source§impl FileProvider
impl FileProvider
Sourcepub fn new(
path: impl AsRef<Path>,
format: SecretFileFormat,
) -> Result<Self, ContextError>
pub fn new( path: impl AsRef<Path>, format: SecretFileFormat, ) -> Result<Self, ContextError>
Create a new file provider.
§Arguments
path- Path to the secrets file or directoryformat- Format of the secrets file(s)
Sourcepub fn with_writes(self) -> Self
pub fn with_writes(self) -> Self
Allow writes to the secrets file.
By default, the file provider is read-only for safety.
Trait Implementations§
Source§impl SecretProvider for FileProvider
impl SecretProvider for FileProvider
Source§fn get_secret<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<SecretValue>, ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_secret<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<SecretValue>, ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get a secret value. Read more
Source§fn set_secret<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
key: &'life2 str,
value: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn set_secret<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
key: &'life2 str,
value: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<(), ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Set a secret value.
Source§fn delete_secret<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete_secret<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Delete a secret.
Source§fn list_keys<'life0, 'life1, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_keys<'life0, 'life1, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List all secret keys for a context.
Source§fn is_read_only(&self) -> bool
fn is_read_only(&self) -> bool
Check if this provider is read-only.
Source§fn has_secret<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn has_secret<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context_id: &'life1 str,
key: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<bool, ContextError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Check if a secret exists.
Auto Trait Implementations§
impl !Freeze for FileProvider
impl RefUnwindSafe for FileProvider
impl Send for FileProvider
impl Sync for FileProvider
impl Unpin for FileProvider
impl UnwindSafe for FileProvider
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