Repository navigation
docs(auth): document and verify least-privilege application roles - #30720
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
mo-bot review · Commit: Review completed. Read the assessment. |
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 63e7a285f22073bab03a12497a1df46f6fcda31a
Assessment: approve
Reviewed both changed files and the underlying authorization and fixture owners. The guide accurately describes existing role-based scopes without broadening privileges. The regression preserves session continuity and checks meaningful positive and negative outcomes. No actionable defects remain; production execution costs are unchanged.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1586-7a01-9000-d45e20995cf8 · slot 1 · generation 1
Validation:
-
The committed TestLeastPrivilegeApplicationRole passed in 13.914s with privilege caching enabled and disabled.
-
A supplemental test-only overlay independently verified wildcard-only grants, existing/future-table CRUD and SELECT, actual session cache modes, catalog teardown and global-setting restoration. Both repetitions passed using one shared fixture.
-
Full pkg/embed go vet, formatting, whitespace, frozen-patch identity and clean-source checks passed.
-
Recovered native prerequisites after verifying 192 current inputs, 46 artifact hashes and the original repository-owner build receipt.
-
Commands, source fingerprints, exit receipts and retained logs were reconciled in /home/xupeng/.local/state/mo-bot/jobs/5e7535c34219c97b5d7e1ca8/attempt-1/validated-evidence.json. Detailed review coverage is retained in review-report.json.
-
The frozen CI snapshot reports successful Ubuntu unit tests and Linux/arm64 static analysis.
Limitations:
-
The committed wildcard phase overlaps exact-table grants; the independent diagnostic probe verified wildcard-only behavior without changing source.
-
Full repository/embed suites and race checks were not rerun locally. Raw CI logs and separate linked-issue replay artifacts were not supplied.
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-xupeng · review
Commit: 63e7a285f22073bab03a12497a1df46f6fcda31a
Assessment: approve
Reviewed the complete documentation/test delta and issue #30626. The guide accurately explains supported privilege scopes, and the real-client regression exercises ownership, live grants/revokes, cache modes and denied operations. No actionable defect remains.
Model: gpt-6-astra / xhigh
Session: 01a15209-2c6d-71e2-b8f3-aa17387fa283 · slot 2 · generation 0
Validation:
-
Traced authorization owners, session-variable inheritance, shared-cluster ownership and fixture cleanup; reviewed existing complementary access-control tests.
-
Verified exact-head CI run 39550538833: UT job 119058528353 completed all eight pkg/embed race-test batches successfully; SCA job 119058528357 succeeded.
-
Audited test-selection wiring, artifact integrity, commands, source fingerprints, exit receipts and retained logs. Evidence mapping is retained in attempt-1/evidence-ledger.json.
-
Clean source and git diff --check passed. Final audit receipt: checks/1792564826581892231-3.json; output: evidence-audit-source.log.
Limitations:
-
The retained CI summary lacks an individual PASS record for the new test; its inclusion follows from full-package inventory selection and successful batch execution.
-
No local Go tests were repeated. BVT jobs were skipped, and author-reported baseline/focused runs were not independently verified.
Merge Queue Status
This pull request spent 6 hours 24 minutes 51 seconds in the queue, with no time running CI. ReasonPull request #30720 has been dequeued Pull request from fork cannot be queued. This pull request comes from a fork, and Mergify needs the author's permission to update its branch.
HintYou should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. Waiting for any of
All conditions
Tick the box to put this pull request back in the merge queue (same as
|
What type of PR is this?
Which issue(s) this PR fixes:
Refs #30626. Documents supported equivalents and prevents regressions; does not claim to implement implicit MySQL GRANT syntax or direct privilege grants to users.
What this PR does / why we need it:
Replayed #30626 on main
04fe057bd73520cdf30754f79f66f6505060ad1fthrough an actual role login. Role-owned UPDATE/DELETE succeeds, including before and after explicit table grants. The reported creator-dependent DML denial is no longer reproducible. The other reported differences are existing explicit RBAC scopes: table DML usesON TABLE db.*, database DDL usesON DATABASE db, privileges are granted to roles, and USE independently requires CONNECT.Add a least-privilege application provisioning guide and a real MySQL-protocol regression instead of weakening object-scope checks or broadening grants. The guide distinguishes DATABASE DDL from database-wide TABLE DML, shows the role-to-user assignment/login and CONNECT requirement, and warns against account-wide table grants and unnecessary delegation. Runtime-only users can omit database DDL grants.
The regression retains the same live role session while grants and revokes commit. With the privilege cache both enabled and disabled, verify:
TABLE db.*grants.The fixture closes clients, drops its own users/roles/databases with a bounded cleanup context, and restores the previous global privilege-cache setting. No parser, privilege storage/checking or persisted catalog changes.
Verification
TestLeastPrivilegeApplicationRolewith vet enabled: PASS (7.947s), including cache-on/off, live grant/revoke and cleanup.git diff --check: PASS.Remaining compatibility boundary
GRANT ... ON db.* TO userwithout an object type, andUPDATE/DELETE ON DATABASE, are not newly accepted by this PR. The documented role-based equivalents work without granting moadmin/accountadmin. Broader MySQL privilege-model emulation would be a separate authorization design, not a safe parser-only relaxation.