pub struct SecretKeyMatcher { /* private fields */ }Expand description
Matches normalized key names that commonly carry secret values.
Names are compared case-insensitively after trimming leading dashes and
normalizing - to _. A key matches when it equals a configured name or
ends with _<name>, allowing names such as db_password while avoiding
false positives such as author.
Implementations§
Source§impl SecretKeyMatcher
impl SecretKeyMatcher
Sourcepub fn new(names: impl IntoIterator<Item = impl AsRef<str>>) -> Self
pub fn new(names: impl IntoIterator<Item = impl AsRef<str>>) -> Self
Create a matcher from a set of secret-bearing names.
Sourcepub fn with_names(
self,
names: impl IntoIterator<Item = impl AsRef<str>>,
) -> Self
pub fn with_names( self, names: impl IntoIterator<Item = impl AsRef<str>>, ) -> Self
Add multiple secret-bearing key names.
Sourcepub fn is_secret_key(&self, name: &str) -> bool
pub fn is_secret_key(&self, name: &str) -> bool
Return true when name should be treated as secret-bearing.
Trait Implementations§
Source§impl Clone for SecretKeyMatcher
impl Clone for SecretKeyMatcher
Source§fn clone(&self) -> SecretKeyMatcher
fn clone(&self) -> SecretKeyMatcher
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SecretKeyMatcher
impl Debug for SecretKeyMatcher
Source§impl Default for SecretKeyMatcher
impl Default for SecretKeyMatcher
impl Eq for SecretKeyMatcher
Source§impl PartialEq for SecretKeyMatcher
impl PartialEq for SecretKeyMatcher
impl StructuralPartialEq for SecretKeyMatcher
Auto Trait Implementations§
impl Freeze for SecretKeyMatcher
impl RefUnwindSafe for SecretKeyMatcher
impl Send for SecretKeyMatcher
impl Sync for SecretKeyMatcher
impl Unpin for SecretKeyMatcher
impl UnsafeUnpin for SecretKeyMatcher
impl UnwindSafe for SecretKeyMatcher
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