-
Notifications
You must be signed in to change notification settings - Fork 16
[DPE-7322] Support predefined roles #652
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
base: main
Are you sure you want to change the base?
Conversation
350dc94
to
90bb3c8
Compare
2bb4cdc
to
ef8e039
Compare
d6ef3e2
to
0d020f4
Compare
e9ba0fb
to
8000b34
Compare
2c8e14b
to
bd05e71
Compare
if len(role_name) >= ROLE_MAX_LENGTH: | ||
logger.warning(f"Pruning application database role name {role_name}") | ||
role_name = role_name[:ROLE_MAX_LENGTH] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This snippet is here to decouple this PR from changes that will be proposed on the MySQL Test app.
In short: there is a length limit on how roles can be named in MySQL (32 characters). MySQL Test app default database name is continuous_writes_database
, which in addition to the charmed_dba
prefix surpasses the limit. I would suggest shorten the default database name to just continuous_writes
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done! Easy to read!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work. Tests are solid
bd05e71
to
77207f7
Compare
PR branch rebased from |
This PR implements the set of predefined roles proposed in this specification.
In addition to the predefined roles proposed to be on sync with PostgreSQL 16 operators, there is an additional one in order to solve a long time standing time debt:
mysqlrouter
. This predefined role is proposed in order to stop treating mysqlrouter as a magic word used to assignALL PRIVILEGES
to the created users whoseextra-user-roles
config argument contained such word. That exact name has been chosen to preserve backwards compatibility.Additional changes:
extra-user-roles
config argument._
) instead of mixing dashes and underscores.