Function deserialize_secret_string

Source
pub fn deserialize_secret_string<'de, D>(
    deserializer: D,
) -> Result<SecretString, D::Error>
where D: Deserializer<'de>,
Expand description

Helper function to deserialize secrets from encrypted base64 storage.

Supports three formats for backwards compatibility:

  1. Encrypted format (v2): base64(encrypted data with AAD)
  2. Legacy encrypted format (v1): base64(encrypted data without AAD)
  3. Plain text format: unencrypted plain string (for data stored before encryption was added)

Uses EncryptionContext for v2 decryption if set.