pub struct SecretDefinition {
pub key: String,
pub description: Option<String>,
pub required: bool,
pub provider: Option<String>,
pub env_var: Option<String>,
pub file_path: Option<String>,
pub file_mode: Option<String>,
}Expand description
Definition of a single secret.
Fields§
§key: StringSecret key name.
description: Option<String>Human-readable description.
required: boolWhether this secret is required.
provider: Option<String>Provider to use (defaults to platform keychain).
env_var: Option<String>Environment variable name to inject as.
file_path: Option<String>File path to write secret to (for file-based secrets).
file_mode: Option<String>File permissions (octal, e.g., “0600”).
Implementations§
Source§impl SecretDefinition
impl SecretDefinition
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set the description.
Sourcepub fn with_provider(self, provider: impl Into<String>) -> Self
pub fn with_provider(self, provider: impl Into<String>) -> Self
Set the provider.
Sourcepub fn inject_as_env(self, env_var: impl Into<String>) -> Self
pub fn inject_as_env(self, env_var: impl Into<String>) -> Self
Set the environment variable to inject as.
Sourcepub fn write_to_file(self, path: impl Into<String>) -> Self
pub fn write_to_file(self, path: impl Into<String>) -> Self
Set the file path to write to.
Sourcepub fn with_file_mode(self, mode: impl Into<String>) -> Self
pub fn with_file_mode(self, mode: impl Into<String>) -> Self
Set the file mode.
Sourcepub fn has_env_var(&self) -> bool
pub fn has_env_var(&self) -> bool
Check if this secret should be injected as an environment variable.
Sourcepub fn has_file_path(&self) -> bool
pub fn has_file_path(&self) -> bool
Check if this secret should be written to a file.
Sourcepub fn injection_targets(&self) -> Vec<SecretInjectionTarget>
pub fn injection_targets(&self) -> Vec<SecretInjectionTarget>
Get the injection targets for this secret.
Trait Implementations§
Source§impl Clone for SecretDefinition
impl Clone for SecretDefinition
Source§fn clone(&self) -> SecretDefinition
fn clone(&self) -> SecretDefinition
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 moreSource§impl Debug for SecretDefinition
impl Debug for SecretDefinition
Source§impl<'de> Deserialize<'de> for SecretDefinition
impl<'de> Deserialize<'de> for SecretDefinition
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SecretDefinition
impl RefUnwindSafe for SecretDefinition
impl Send for SecretDefinition
impl Sync for SecretDefinition
impl Unpin for SecretDefinition
impl UnwindSafe for SecretDefinition
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