pub struct UserRecord {
pub role: Role,
/* private fields */
}Fields§
§role: RoleImplementations§
Source§impl UserRecord
impl UserRecord
pub fn verify(&self, password: &str) -> bool
pub const fn scram(&self) -> Option<&ScramSecrets>
Sourcepub const fn mysql_native(&self) -> Option<&[u8; 20]>
pub const fn mysql_native(&self) -> Option<&[u8; 20]>
v7.17.0 Phase 3.P0-71: borrow the stored
mysql_native_password verifier (SHA1(SHA1(password)))
for the MySQL-wire shim.
Sourcepub const fn caching_sha2(&self) -> Option<&[u8; 32]>
pub const fn caching_sha2(&self) -> Option<&[u8; 32]>
v7.17.0 Phase 3.P0-72: borrow the stored
caching_sha2_password verifier (SHA256(SHA256(password)))
for the MySQL-wire shim’s fast-path auth.
Sourcepub fn verify_caching_sha2_password(
&self,
scramble: &[u8],
client_response: &[u8],
) -> bool
pub fn verify_caching_sha2_password( &self, scramble: &[u8], client_response: &[u8], ) -> bool
v7.17.0 Phase 3.P0-72 — verify a client
caching_sha2_password fast-path response.
Protocol: same XOR shape as mysql_native_password but
with SHA-256 instead of SHA-1:
client_response = SHA256(password) XOR SHA256(scramble || SHA256(SHA256(password))). Server reconstructs and
checks SHA256(reconstructed) == stored_hash.
Full-auth RSA fallback (when the cache misses) is a v7.18 carve-out — clients connecting over plaintext without a cached entry will see Access Denied from the shim until that lands.
Sourcepub fn verify_mysql_native_password(
&self,
scramble: &[u8],
client_response: &[u8],
) -> bool
pub fn verify_mysql_native_password( &self, scramble: &[u8], client_response: &[u8], ) -> bool
v7.17.0 Phase 3.P0-71 — verify a client
mysql_native_password auth response.
Protocol: the client sends a 20-byte response
client_proof = SHA1(password) XOR SHA1(scramble || SHA1(SHA1(password))). The server reconstructs
SHA1(password) = client_proof XOR SHA1(scramble || stored_hash) and verifies SHA1(reconstructed) == stored_hash. Returns false if the user has no stored
hash (loaded from a pre-v7.17 snapshot — the operator
has to reset the password to re-populate it).
Trait Implementations§
Source§impl Clone for UserRecord
impl Clone for UserRecord
Source§fn clone(&self) -> UserRecord
fn clone(&self) -> UserRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more