Expand description
User table + RBAC types for v4.1.
Three roles, narrow on purpose:
Admin— full read+write + can manage other usersReadWrite— full read+write, no user-mgmtReadOnly— SELECT / SHOW only
Passwords stored as BLAKE3(salt || password) — the salt is a random 16-byte value per user, kept inline with the record so we never need to hash twice. The hash is not designed to resist a determined offline attack on the snapshot file (that’s what file perms are for in the docker-compose deployment shape); it’s enough that the snapshot itself doesn’t leak plaintext, and that an in-memory dump can’t trivially reverse a typed password.
Structs§
- Scram
Secrets - SCRAM-SHA-256 stored credentials per RFC 5802 §5.
saltanditersare sent to the client in server-first;stored_keyandserver_keyare kept secret and used in the final-message verification. - User
Record - User
Store
Enums§
Constants§
- CACHING_
SHA2_ HASH_ LEN - v7.17.0 Phase 3.P0-72 — length of SHA256(SHA256(password))
stored per user for
caching_sha2_passwordauth verification (the MySQL 8.0 default plugin). - MYSQL_
NATIVE_ HASH_ LEN - v7.17.0 Phase 3.P0-71 — length of SHA1(SHA1(password)) stored
per user for
mysql_native_passwordauth verification. - SCRAM_
DEFAULT_ ITERS - SCRAM_
SALT_ LEN
Functions§
- compute_
caching_ sha2_ hash - v7.17.0 Phase 3.P0-72 — compute the
caching_sha2_passwordstored hash = SHA256(SHA256(password)). Public for the same reason as the mysql_native variant. - compute_
mysql_ native_ hash - Compute the
mysql_native_passwordstored hash = SHA1(SHA1(password)). Public so user-creation paths can populate the field at the same moment they have cleartext. - compute_
scram_ secrets - v4.8: derive SCRAM-SHA-256 stored credentials per RFC 5802 §3.