pub fn encrypted_password(name: &str, password: &str) -> Option<AuthInfo>
Expand description
Try to extract the encryption password from given password. The password is always stored
encrypted in the system catalogs. The ENCRYPTED keyword has no effect, but is accepted for
backwards compatibility. The method of encryption is by default SHA-256-encrypted. If the
presented password string is already in MD5-encrypted or SHA-256-encrypted format, then it is
stored as-is regardless of password_encryption
(since the system cannot decrypt the specified
encrypted password string, to encrypt it in a different format).
For an MD5 encrypted password, rolpassword column will begin with the string md5 followed by a 32-character hexadecimal MD5 hash. The MD5 hash will be of the user’s password concatenated to their user name. For example, if user joe has password xyzzy, we will store the md5 hash of xyzzyjoe.
For an SHA-256 encrypted password, rolpassword column will begin with the string SHA-256: followed by a 64-character hexadecimal SHA-256 hash, which is the SHA-256 hash of the user’s password concatenated to their user name. The SHA-256 will be the default hash algorithm for Risingwave.
A password that does not follow either of those formats is assumed to be unencrypted.