-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mysql_user: get rid of privs comparison #234
Comments
@bmalynovytch @Jorge-Rodriguez @rsicart let's discuss this issue ^. These are just quick thoughts to discuss and find the best solution, maybe completely different from what i wrote in the description. Whatever option we'll choose, @rsicart , would you like to continue to work in this direction? |
I'd go for option 1, personally I do not see a benefit on locally checking a static list of allowed privileges which needs to be maintained. We have other use cases in the code base where a parameter's accepted values are "whatever mysql accepts". Additionally, and unless I'm sorely mistaken, the only privilege on that list that is not supported by mysql (i.e. has a special meaning for the module) is |
I’d like to work on it, but I’m not sure to have time. Personally I’d choose option 1 too. Options 2 and 3 are nice but from my point of view they’ll add legacy code to maintain. About option 1, we should check if it’s possible to get idempotency right. |
@rsicart idempotence might be a problem with dynamic privileges. To my mind the way it could be done is query the user's privileges and, instead of comparing to the current |
@rsicart would be great. And no rush and pressure with this. Whoever will do it, I'd be happy to review things |
FYI: If anyone is eager to pick it up, welcome (please put it explicitly in here). |
SUMMARY
(this is a thing to discuss)
We should analyze possibility to get rid of privs comparison entirely and use just a mechanisms like "try except": let's let the server decide which privs are supported and throw the exception itself.
A solution can conceptually look like the following:
However this is a breaking change and we'll require a major release in the future.
Possible scenarios:
Option 1 (Most votes are for this variant):
Option 2 (not breaking but downside is one more argument):
check_privs
with defaultyes
)no
- comparison will be skippedOption 3:
check_privs
will getno
as its default in 4.0.0Option 4:
CONTEXT
VALID_PRIVS
frozenset.SHOW PRIVILEGES
command.SHOW PRIVILEGES
output but they were present in theVALID_PRIVS
frozenset.VALID_PRIVS
brought breaking changes.VALID_PRIVS
and now the module merges it in a frozenset withshow_privs
(fetched from server dynamically) andEXTRA_PRIVS
.Relates to #233
Relates to #217
The text was updated successfully, but these errors were encountered: