pub struct KeyRedactor { /* private fields */ }Expand description
Redacts values whose key matches a denylist, case-insensitively.
§Examples
use ash_log::*;
use std::sync::Arc;
let logger = ash_logger!(
backend: Arc::new(NoopAuditBackend),
redact: Arc::new(KeyRedactor::default().and("session_id")),
);
// `password` is on the default list; `session_id` was added above.
ash_info!(logger, "login"; password = "hunter2", session_id = "abc");Implementations§
Source§impl KeyRedactor
impl KeyRedactor
Sourcepub const DEFAULT_KEYS: &'static [&'static str]
pub const DEFAULT_KEYS: &'static [&'static str]
The conventional secret-bearing key names.
Matching is on substrings by default, so api_key, apiKey, and
x-api-key are all caught by key.
Trait Implementations§
Source§impl Clone for KeyRedactor
impl Clone for KeyRedactor
Source§impl Debug for KeyRedactor
impl Debug for KeyRedactor
Source§impl Default for KeyRedactor
impl Default for KeyRedactor
Source§fn default() -> Self
fn default() -> Self
A redactor loaded with DEFAULT_KEYS.
Auto Trait Implementations§
impl Forget for KeyRedactor
impl Freeze for KeyRedactor
impl Move for KeyRedactor
impl RefUnwindSafe for KeyRedactor
impl Send for KeyRedactor
impl Sync for KeyRedactor
impl Unpin for KeyRedactor
impl UnsafeUnpin for KeyRedactor
impl UnwindSafe for KeyRedactor
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