cowl/unsafe

Values

pub fn reveal(secret: cowl.Secret(a)) -> a

Extract the raw value from a secret.

Once the value is in a plain variable the compiler can no longer protect it. Keep the scope as small as possible and never assign it to a field that outlives the current function.

Prefer cowl.with_secret for all production use.

pub fn tap_raw(
  secret: cowl.Secret(a),
  f: fn(a) -> b,
) -> cowl.Secret(a)

Run f on the raw value for its side effects; return the original secret.

⚠️ Passing a logging or print function here will expose the secret in plain text. This function exists for low-level debugging and test instrumentation only.

For safe side effects use cowl.tap_masked instead.

Search Document