pub struct ProviderKeyRedactor { /* private fields */ }Expand description
Replaces configured provider keys without changing the credentials sent upstream.
Apply this after response translation, including to preserved provider fields. Each call is independent: keys split across stream events or separate JSON strings are not reconstructed. This is exact substring matching, not a general secret detector.
Implementations§
Source§impl ProviderKeyRedactor
impl ProviderKeyRedactor
Sourcepub fn new(keys: &[String]) -> Self
pub fn new(keys: &[String]) -> Self
Registers nonempty keys, matching longer keys before their prefixes.
Sourcepub fn json(&self, value: String) -> String
pub fn json(&self, value: String) -> String
Redacts JSON-escaped keys in serialized JSON, preserving the server’s wire behavior.
Trait Implementations§
Source§impl Default for ProviderKeyRedactor
impl Default for ProviderKeyRedactor
Source§fn default() -> ProviderKeyRedactor
fn default() -> ProviderKeyRedactor
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ProviderKeyRedactor
impl RefUnwindSafe for ProviderKeyRedactor
impl Send for ProviderKeyRedactor
impl Sync for ProviderKeyRedactor
impl Unpin for ProviderKeyRedactor
impl UnsafeUnpin for ProviderKeyRedactor
impl UnwindSafe for ProviderKeyRedactor
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