-
Notifications
You must be signed in to change notification settings - Fork 5
[DPE-7322] Support predefined roles #269
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
03dc3c6
to
3d1f6a2
Compare
3d1f6a2
to
ec166ee
Compare
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.
looks good except a couple nits
@@ -150,6 +170,23 @@ def add_attributes_to_mysql_router_user( | |||
self._run_sql([f"ALTER USER `{username}` ATTRIBUTE '{attributes}'"]) | |||
logger.debug(f"Added {attributes=} to {username=}") | |||
|
|||
# TODO python3.10 min version: Use `set` instead of `typing.Set` | |||
def get_mysql_roles(self, name_pattern: str) -> typing.Set[str]: |
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.
def get_mysql_roles(self, name_pattern: str) -> typing.Set[str]: | |
def _get_mysql_roles(self, name_pattern: str) -> typing.Set[str]: |
nit
def create_application_database_and_user(self, *, username: str, database: str) -> str: | ||
"""Create database and user for related database_provides application.""" | ||
def create_application_database(self, *, database: str) -> str: |
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.
on the public interface (of mysql_shell), could we keep this as one method since it should always be called together?
e.g. if you want to have it split into two functions internally, suggest something like
def create_application_database_and_user():
self._create_application_database()
self._create_application_user()
ROLE_DML = "charmed_dml" | ||
ROLE_READ = "charmed_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.
ROLE_DML = "charmed_dml" | |
ROLE_READ = "charmed_read" | |
_ROLE_DML = "charmed_dml" | |
_ROLE_READ = "charmed_read" |
nit
This PR supports the set of predefined roles proposed in this specification.