pub struct EnvRedactor { /* private fields */ }Expand description
Applies one immutable redaction policy to environment-variable values.
Implementations§
Source§impl EnvRedactor
impl EnvRedactor
Sourcepub fn redact_pair(&self, name: &str, value: &str) -> RedactedEnvPair
pub fn redact_pair(&self, name: &str, value: &str) -> RedactedEnvPair
Redacts one UTF-8 environment-variable pair.
Both components are escaped before they can be displayed. The value is
classified from name using the adapter’s immutable policy.
§Parameters
name- Environment-variable name used for classification.value- Environment-variable value to redact when sensitive.
§Returns
A log-safe pair rendered as NAME=VALUE.
Sourcepub fn redact_pair_with_session(
&self,
name: &str,
value: &str,
session: &RedactionSession<'_>,
) -> RedactedEnvPair
pub fn redact_pair_with_session( &self, name: &str, value: &str, session: &RedactionSession<'_>, ) -> RedactedEnvPair
Redacts one UTF-8 pair through a shared operation session.
Sourcepub fn redact_os_pair(&self, name: &OsStr, value: &OsStr) -> RedactedEnvPair
pub fn redact_os_pair(&self, name: &OsStr, value: &OsStr) -> RedactedEnvPair
Redacts one environment pair whose components may not be UTF-8.
If either component is invalid UTF-8, the original value is never rendered or supplied to an edge-preserving mask. Instead, the secret opaque replacement is used. A non-UTF-8 name is rendered lossily and escaped for diagnostics.
§Parameters
name- Operating-system environment-variable name.value- Operating-system environment-variable value.
§Returns
A fail-closed, log-safe pair rendered as NAME=VALUE.
Sourcepub fn redact_os_pairs<'a, I>(&self, pairs: I) -> LogSafeText<'static>
pub fn redact_os_pairs<'a, I>(&self, pairs: I) -> LogSafeText<'static>
Redacts environment pairs into one bounded log-safe list.
The adapter stops before inspecting a pair that would exceed the policy’s diagnostic input budget. It also stops once the escaped list reaches the diagnostic output budget.
§Type Parameters
'a- Lifetime of environment names and values yielded by the iterator.I- Iterator source yielding borrowed environment pairs.
§Parameters
pairs- Operating-system environment names and values to redact.
§Returns
A debug-style log-safe list of redacted assignments.
Sourcepub fn redact_os_pairs_with_session<'a, I>(
&self,
pairs: I,
session: &RedactionSession<'_>,
) -> LogSafeText<'static>
pub fn redact_os_pairs_with_session<'a, I>( &self, pairs: I, session: &RedactionSession<'_>, ) -> LogSafeText<'static>
Redacts environment pairs through one cumulative diagnostic session.
Sourcepub fn redact_assignment(&self, assignment: &str) -> RedactedEnvPair
pub fn redact_assignment(&self, assignment: &str) -> RedactedEnvPair
Trait Implementations§
Source§impl Clone for EnvRedactor
impl Clone for EnvRedactor
Source§fn clone(&self) -> EnvRedactor
fn clone(&self) -> EnvRedactor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EnvRedactor
impl Debug for EnvRedactor
Source§impl Default for EnvRedactor
impl Default for EnvRedactor
Source§fn default() -> Self
fn default() -> Self
Creates an environment redactor from the current default policy snapshot.
§Returns
An environment redactor backed by Redactor::default.