raghav-reglobe commented on PR #70371: URL: https://github.com/apache/doris/pull/70371#issuecomment-7042979457
@morningman @CalvinKirs Agreed. The head now implements the membership rule, rebased on today's master. **Role grants** - `GRANT role TO user` and `CREATE USER ... DEFAULT ROLE` need `GRANT_PRIV` and the role itself: the grantor must already hold the role. `ADMIN_PRIV` grants any role. - Holding every privilege a role carries is not holding the role. The unit test and the e2e suite assert it; the unit test also for a role that carries nothing. - `GRANT privilege` is as on master. The per-object comparison of the earlier head is gone. **Points to confirm** 1. *What "holds" means.* I count a role that is granted to the account in Doris. A role that reaches a session from an LDAP group or from the role mapping of an authentication integration does not count: the grant would store a membership that outlives the outside one, and `UserIdentity` says such roles are never persisted as account grants. The session case has a unit test; the LDAP case has none of its own. Say if those should count. 2. *`REVOKE role`* is unchanged (`GRANT_PRIV`). Should it follow the same membership rule? 3. *Taken out, because they go beyond the two rules:* the `NODE_PRIV` check on a role grant (the direct `GRANT NODE_PRIV` keeps its own rule), and the storage-vault routing fix in the direct `GRANT ... ON STORAGE VAULT` check. I can restore the first here if you want it, and send the second as its own PR. 4. *One consequence for the docs:* an account with `GRANT_PRIV` and without `ADMIN_PRIV` can still `CREATE ROLE`, but can assign that role only after an administrator grants it the role. **Credentials, after the rebase over the dual-password change** - Another account's password, authentication binding or `REQUIRE` clause needs `ADMIN_PRIV`, as before. `RETAIN CURRENT PASSWORD` on another account rides a password change, so it needs `ADMIN_PRIV` too. - On one's own account `RETAIN CURRENT PASSWORD` stays under `GRANT_PRIV`, as #66115 set it. `DISCARD OLD PASSWORD` stays under `GRANT_PRIV`, like `ACCOUNT_LOCK`. - `AlterUserStmtTest` had two cases the credential rule broke (a certificate requirement set on another account under a `GRANT_PRIV`-only mock). Fixed. The e2e suite you added now asserts the membership rule: a grantor that holds the role's privileges but not the role is refused, and is allowed once it holds the role. **Picks.** The head now touches dual-password code, so the 4.2 pick wants the pick of #66115 first, and a 4.1 pick needs those hunks left out. Run on the rebased head: fe-core checkstyle and 42 FE unit-test classes (the auth, user, password, role and policy tests). I did not run the regression suites. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
