Function lock_keeper::infrastructure::sensitive_info::sensitive_info_check
source · pub fn sensitive_info_check<T: Debug + Display>(
sensitive_info: &T,
config: &SensitiveInfoConfig
) -> Result<(), CryptoError>
Expand description
Checks if sensitive information is properly redacted in Debug and Display outputs.
This function takes a generic sensitive_info
object and a config
object
which provides the redaction configuration.
The sensitive_info
object should implement the Debug
and Display
traits so that it can be properly formatted for output.
The function checks if the redaction is correctly applied based on the configuration and the build type (Release or Debug).
§Arguments
sensitive_info
- A reference to an object of any type that implementsDebug
andDisplay
.config
- A reference to aSensitiveInfoConfig
object which provides the redaction configuration.
§Returns
Ok(())
- If the sensitive information is correctly redacted in both Debug and Display outputs.Err(CryptoError::SensitiveInfoCheckFailed)
- If the sensitive information is not correctly redacted.
§Panics
This function does not panic. However, the caller should handle the Err
result appropriately.