pub struct SensitiveInfoConfig {
    redact_sensitive_info: bool,
}
Expand description

The SensitiveInfoConfig type is used to configure how we handle sensitive information (cryptographic keys, passwords, etc.) when using Display and Debug.

Fields§

§redact_sensitive_info: bool

A boolean indicating whether sensitive information should be redacted. If set to true, the sensitive information will be redacted (hidden or masked). If set to false, the sensitive information will not be redacted.

Implementations§

source§

impl SensitiveInfoConfig

source

const REDACTED_INFO_LABEL: &'static str = "***REDACTED***"

Tis is the label used to redact sensitive information in the library output

source

pub fn new(redact_sensitive_info: bool) -> Self

Constructor for SensitiveInfoConfig type. The default is to redact sensitive information in the output. Constructs a new instance of the type SensitiveInfoConfig

§Arguments
  • redact_sensitive_info - A boolean indicating whether to redact sensitive information. - When set to true, any sensitive information handled by instances using this configuration will be redacted (hidden or masked). - When set to false, the sensitive information will not be redacted.
§Returns
  • Returns a new instance of SensitiveInfoConfig, initialized with the provided redact_sensitive_info flag.
§Example
use lock_keeper::infrastructure::sensitive_info::SensitiveInfoConfig;
let redact_sensitive_info = true;
let config = SensitiveInfoConfig::new(redact_sensitive_info);
source

pub fn redacted_label(self) -> String

Returns a label that is used in place of sensitive information.

source

pub fn redact(&mut self)

Redact sensitive information.

source

pub fn unredact(&mut self)

Unredact sensitive information.

source

pub fn is_redacted(&self) -> bool

Returns the status of the sensitive information redaction.

Trait Implementations§

source§

impl Clone for SensitiveInfoConfig

source§

fn clone(&self) -> SensitiveInfoConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'de> Deserialize<'de> for SensitiveInfoConfig

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Drop for SensitiveInfoConfig

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl PartialEq for SensitiveInfoConfig

source§

fn eq(&self, other: &SensitiveInfoConfig) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for SensitiveInfoConfig

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<SensitiveInfoConfig> for Vec<u8>

Conversion from SensitiveInfoConfig to Vec<u8>

§

type Error = CryptoError

The type returned in the event of a conversion error.
source§

fn try_from(config: SensitiveInfoConfig) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<Vec<u8>> for SensitiveInfoConfig

Conversion from Vec<u8> to SensitiveInfoConfig

§

type Error = CryptoError

The type returned in the event of a conversion error.
source§

fn try_from(bytes: Vec<u8>) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Zeroize for SensitiveInfoConfig

source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.
source§

impl Eq for SensitiveInfoConfig

source§

impl StructuralPartialEq for SensitiveInfoConfig

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> ConvertMessage for T
where T: for<'a> Deserialize<'a> + Serialize,

source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,