pub struct SecretBrokerPolicy {
pub enabled: bool,
pub secret_suffixes: Vec<String>,
pub secret_prefixes: Vec<String>,
pub secret_exact: Vec<String>,
pub disclosure_allowlist: Vec<String>,
pub redaction_placeholder: String,
}Expand description
Patterns used to identify environment variables likely to contain secrets.
The broker uses suffix and prefix matching to catch common naming conventions for API keys, tokens, passwords, and credentials.
Fields§
§enabled: boolWhen true, the secret broker is active.
secret_suffixes: Vec<String>Env var name suffixes that indicate a secret (case-insensitive).
secret_prefixes: Vec<String>Env var name prefixes that indicate a secret (case-insensitive).
secret_exact: Vec<String>Exact env var names that are always treated as secrets (case-insensitive).
disclosure_allowlist: Vec<String>Env vars on this list are never redacted, even if they match a pattern.
redaction_placeholder: StringThe replacement string used in place of secret values.
Implementations§
Source§impl SecretBrokerPolicy
impl SecretBrokerPolicy
Sourcepub fn is_secret(&self, name: &str) -> bool
pub fn is_secret(&self, name: &str) -> bool
Returns true if the given env var name matches a known secret pattern.
Sourcepub fn maybe_redact<'a>(&'a self, name: &str, value: &'a str) -> &'a str
pub fn maybe_redact<'a>(&'a self, name: &str, value: &'a str) -> &'a str
Redact a value if the env var name is a secret.
Returns the original value if not a secret, or the redaction placeholder if it is.
Trait Implementations§
Source§impl Clone for SecretBrokerPolicy
impl Clone for SecretBrokerPolicy
Source§fn clone(&self) -> SecretBrokerPolicy
fn clone(&self) -> SecretBrokerPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SecretBrokerPolicy
impl Debug for SecretBrokerPolicy
Source§impl Default for SecretBrokerPolicy
impl Default for SecretBrokerPolicy
Source§impl<'de> Deserialize<'de> for SecretBrokerPolicywhere
SecretBrokerPolicy: Default,
impl<'de> Deserialize<'de> for SecretBrokerPolicywhere
SecretBrokerPolicy: Default,
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>,
Source§impl PartialEq for SecretBrokerPolicy
impl PartialEq for SecretBrokerPolicy
Source§impl Serialize for SecretBrokerPolicy
impl Serialize for SecretBrokerPolicy
impl Eq for SecretBrokerPolicy
impl StructuralPartialEq for SecretBrokerPolicy
Auto Trait Implementations§
impl Freeze for SecretBrokerPolicy
impl RefUnwindSafe for SecretBrokerPolicy
impl Send for SecretBrokerPolicy
impl Sync for SecretBrokerPolicy
impl Unpin for SecretBrokerPolicy
impl UnsafeUnpin for SecretBrokerPolicy
impl UnwindSafe for SecretBrokerPolicy
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> ModelDump for Twhere
T: Serialize,
impl<T> ModelDump for Twhere
T: Serialize,
Source§fn model_dump(&self, options: DumpOptions) -> Result<Value, Error>
fn model_dump(&self, options: DumpOptions) -> Result<Value, Error>
Source§fn model_dump_json(&self) -> Result<String, Error>
fn model_dump_json(&self) -> Result<String, Error>
Source§fn model_dump_json_pretty(&self) -> Result<String, Error>
fn model_dump_json_pretty(&self) -> Result<String, Error>
Source§fn model_dump_json_with_options(
&self,
options: DumpOptions,
) -> Result<String, Error>
fn model_dump_json_with_options( &self, options: DumpOptions, ) -> Result<String, Error>
Source§impl<T> ModelValidate for Twhere
T: DeserializeOwned,
impl<T> ModelValidate for Twhere
T: DeserializeOwned,
Source§fn model_validate(
input: impl Into<ValidateInput>,
options: ValidateOptions,
) -> Result<T, ValidationError>
fn model_validate( input: impl Into<ValidateInput>, options: ValidateOptions, ) -> Result<T, ValidationError>
Source§fn model_validate_json(json: &str) -> Result<Self, ValidationError>
fn model_validate_json(json: &str) -> Result<Self, ValidationError>
Source§fn model_validate_dict(
dict: HashMap<String, Value>,
) -> Result<Self, ValidationError>
fn model_validate_dict( dict: HashMap<String, Value>, ) -> Result<Self, ValidationError>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().