Redacted
The Redacted module provides functionality for handling sensitive information securely within your application.
By using the Redacted
data type, you can ensure that sensitive values are not accidentally exposed in logs or error messages.
The Redacted.make
function creates a Redacted<A>
instance from a given value A
, ensuring the content is securely hidden.
Example (Hiding Sensitive Information from Logs)
Using Redacted.make
helps prevent sensitive information, such as API keys, from being accidentally exposed in logs or error messages.
The Redacted.value
function retrieves the original value from a Redacted
instance. Use this function carefully, as it exposes the sensitive data, potentially making it visible in logs or accessible in unintended ways.
Example (Accessing the Underlying Sensitive Value)
The Redacted.unsafeWipe
function erases the underlying value of a Redacted
instance, making it inaccessible. This helps ensure that sensitive data does not remain in memory longer than needed.
Example (Wiping Sensitive Data from Memory)
The Redacted.getEquivalence
function generates an Equivalence for Redacted<A>
values using an Equivalence for the underlying values of type A
. This allows you to compare Redacted
values securely without revealing their content.
Example (Comparing Redacted Values)