Krikri::PluginHelpers::MysqlPrivileges
MysqlPrivileges - pure logic for parsing/comparing MySQL privilege grants. No I/O - mysql_user.cr does the actual GRANT/REVOKE calls.
Class methods
Reduces a full SHOW GRANTS result to the same {target => privileges} shape parse_spec produces, for direct comparison.
Parses one line of real SHOW GRANTS FOR user@host output, e.g.
GRANT SELECT, INSERT ON \db`.* TO `user`@`host`, optionally suffixed WITH GRANT OPTION(mapped to a "GRANT" pseudo-privilege, matching real Ansible's own priv: convention for the grant option). Returns nil for the baselineGRANT USAGE ON . TO ... IDENTIFIED BY ...` identity row every
MySQL/MariaDB account has regardless of what's actually been
granted to it - not a real privilege grant, and would otherwise
always show up as a spurious diff against any desired priv: spec.