Expand description
Versioned XChaCha20-Poly1305 persistence encryption for OAuth tokens.
When AccountConfig::encrypt_oauth_tokens is true, access tokens,
refresh tokens, and ID tokens are encrypted before being persisted and
decrypted transparently on read.
Structs§
- Encrypted
Token Set - A set of OAuth tokens (access, refresh, id) after conditional encryption.
Functions§
- decrypt_
token - Decrypt a token with a single persistence key, passing through plaintext.
- decrypt_
token_ with_ config - Source recognizes even-length hexadecimal (and versioned
$ba$envelopes) as ciphertext. Other strings, including old plaintext tokens, pass through. - encrypt_
token - Encrypt a plaintext string with a single persistence key.
- encrypt_
token_ set - Read
encrypt_oauth_tokensandsecretfrom the auth context and conditionally encrypt a full set of OAuth tokens in one call. - encrypt_
token_ with_ config - Encrypt a plaintext string with the current configured persistence key.
- maybe_
decrypt - Conditionally decrypt a token with a single persistence key.
- maybe_
decrypt_ with_ config - Conditionally decrypt a token value. Returns the original value when encryption is disabled, or the decrypted value when enabled.
- maybe_
encrypt - Conditionally encrypt a token with a single persistence key.
- maybe_
encrypt_ with_ config - Conditionally encrypt a token value. Returns the original value when encryption is disabled, or the encrypted value when enabled.