-
Notifications
You must be signed in to change notification settings - Fork 234
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
Add databricks scim command to expose the SCIM api: #311
base: main
Are you sure you want to change the base?
Conversation
…development Fix delete method to only return an empty dict if there was no body in the response.
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.
See change requests in context of specific methods.
@@ -62,6 +63,7 @@ def cli(): | |||
cli.add_command(secrets_group, name='secrets') | |||
cli.add_command(stack_group, name='stack') | |||
cli.add_command(groups_group, name='groups') | |||
cli.add_command(scim_group, name='scim') |
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.
can you split scim
into two commands - users
& groups
(groups_group
can also be changed). for end users this is what would make the most sense, not SCIM (which is heavily enterprise-admin focused).
|
||
|
||
class ScimApi(object): | ||
GROUP_NAME_FILTER = 'displayName eq {}' |
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.
if group name got spaces in it, this condition will fail. please quote it
filters=self.GROUP_NAME_FILTER.format(group_name), | ||
data=content) | ||
|
||
def get_group_name_for_group(self, group_id): |
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.
change to get_group_name_by_id
content = self.list_users(filters=filters) | ||
return content | ||
|
||
def get_user_id_for_user(self, user_name): |
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.
change name to get_user_id_by_name
filters=self.USER_NAME_FILTER.format(user_name), | ||
data=content) | ||
|
||
def get_group_id_for_group(self, group_name): |
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.
change to get_group_id_by_name
|
||
|
||
@click.command(context_settings=CONTEXT_SETTINGS, | ||
short_help='NOT IMPLEMENTED') |
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.
please remove or implement
@click.command(context_settings=CONTEXT_SETTINGS, | ||
short_help='List groups') | ||
@click.option('--filters', default=None, required=False, help=FILTERS_HELP) | ||
@click.option('--group-id', metavar='<int>', cls=OptionalOneOfOption, default=None, |
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.
why not --id
and --name
- it's already clear from command name it's group or user.
@click.option('--group-name', required=True) | ||
@click.option('--member', 'members', is_flag=False, default=None, metavar='<members>', | ||
type=click.STRING, | ||
help='members to add to the group', multiple=True, required=False) |
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.
add more docs here - is it --member user.name@example.com --member user2@example.com
or it is --member id --member id2
.
TBD:
it's preferable to have databricks groups create "Data Science" --user-name ben@example.com --user-name john@example.com --group-name "Data Interns"
@eat_exceptions | ||
@provide_api_client | ||
# pylint:disable=unused-argument | ||
def groups_update_cli(api_client, group_id, operation, path, values): |
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.
add more semantic commands here. see comment about users.
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.
See change requests in context of specific methods.
Please also add 85% unit test coverage for new code to match quality assurance criteria for other code in this repo - https://codecov.io/gh/databricks/databricks-cli/tree/master/databricks_cli
Codecov Report
@@ Coverage Diff @@
## master #311 +/- ##
=========================================
Coverage ? 81.64%
=========================================
Files ? 41
Lines ? 3083
Branches ? 0
=========================================
Hits ? 2517
Misses ? 566
Partials ? 0
Continue to review full report at Codecov.
|
FYI: This is stale, it has semi-useful code but has a lot to be addressed. |
https://docs.databricks.com/dev-tools/api/latest/scim/index.html