feat(users): database user & privilege management (MySQL/MariaDB)#478
Open
pokertour wants to merge 3 commits into
Open
feat(users): database user & privilege management (MySQL/MariaDB)#478pokertour wants to merge 3 commits into
pokertour wants to merge 3 commits into
Conversation
New "Users & Privileges" tab for drivers with the user_management capability: - list server accounts (locked flag, degraded fallback to CURRENT_USER when mysql.user is not readable) - create user with optional initial privileges on a chosen scope - change password, drop user (confirmed) - privilege editor: one card per scope (global / database / table) with checkboxes reflecting parsed SHOW GRANTS; checking grants, unchecking revokes (revoke-first so ALL PRIVILEGES -> subset works) - raw SHOW GRANTS output kept for grants the editor cannot model (roles, column-level, proxy) Extensible by design: privilege catalog comes from the driver, all seven trait methods are forwarded over JSON-RPC so external plugins (e.g. MongoDB) can opt in via capabilities.userManagement; PostgreSQL support is planned as a follow-up. SQL builders validate privileges against per-scope allowlists and escape literals per the server sql_mode; builders and grant parser are unit-tested.
| grant: bool, | ||
| ) -> Result<(), String> { | ||
| log::info!( | ||
| "{} privileges for '{user}'@'{host}' on {}", |
Contributor
There was a problem hiding this comment.
SUGGESTION: Log message omits table name for table-scope privilege changes
When database is Some("db") and table is Some("tbl"), the log currently prints "on db" instead of "on db.tbl", making audit logs ambiguous for table-level grants. Consider building a scope string that includes the table when present.
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Contributor
Code Review SummaryStatus: 2 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (17 files)
Fix these issues in Kilo Cloud Reviewed by kimi-k2.6 · Input: 162.8K · Output: 39.1K · Cached: 2.4M |
…feat/db-user-management # Conflicts: # src-tauri/Cargo.lock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New "Users & Privileges" tab for drivers with the user_management capability:
Extensible by design: privilege catalog comes from the driver, all seven trait methods are forwarded over JSON-RPC so external plugins (e.g. MongoDB) can opt in via capabilities.userManagement; PostgreSQL support is planned as a follow-up. SQL builders validate privileges against per-scope allowlists and escape literals per the server sql_mode; builders and grant parser are unit-tested.