Expand description
Wrapper types for sensitive values backed by the secrecy crate.
The whole point of these wrappers is auditability: the only way to read the
plaintext is expose_secret(), so grep expose_secret enumerates every site
where a secret could leak. To keep that guarantee, these types intentionally do
not implement Deref, Display, AsRef<str>, Into<String>, or any plain
getter. Do not add them.
DbSecret— a secret string that flows through thesqlxquery!/query_as!macros. Map columns to it viasqlx.tomltable-overrides. Backed bySecretString(zeroized on drop, redacted fromDebug). The only plaintext-read points are itsEncodeimpl (writing to the DB) and explicitexpose_secret()calls.OutboundSecret— a secret string that is intended to be serialized onto the wire exactly once (e.g. an OAuth/verification token returned to the caller). It redacts inDebug(so it never leaks into logs) but itsSerializeimpl emits the raw value. That singleSerializeimpl is the one audited exposure point.
Structs§
- DbSecret
- A secret string stored in / read from the database.
- Outbound
Secret - A secret string that is deliberately serialized onto the wire once (e.g. a token returned to the caller from an auth endpoint).