From 89225eff12b5e92b29b12f782accce6f8255c7d0 Mon Sep 17 00:00:00 2001 From: rpisani5c <55719539+rpisani5c@users.noreply.github.com> Date: Tue, 27 Oct 2020 12:33:44 -0500 Subject: [PATCH 1/2] Update keycloak_admin.py Swapped the names for get_group_client_roles & delete_group_client_roles respectively. Updated usage, removed the roles object build for the get_ method. --- keycloak/keycloak_admin.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/keycloak/keycloak_admin.py b/keycloak/keycloak_admin.py index ae443b6..53ddab4 100644 --- a/keycloak/keycloak_admin.py +++ b/keycloak/keycloak_admin.py @@ -1072,9 +1072,9 @@ class KeycloakAdmin: data=json.dumps(payload)) return raise_error_from_response(data_raw, KeycloakGetError, expected_codes=[204]) - def delete_group_client_roles(self, group_id, client_id, roles): + def get_group_client_roles(self, group_id, client_id): """ - Delete client roles of a group + Get client roles of a group :param group_id: id of group :param client_id: id of client (not client-id) @@ -1082,14 +1082,13 @@ class KeycloakAdmin: :return Keycloak server response """ - payload = roles if isinstance(roles, list) else [roles] params_path = {"realm-name": self.realm_name, "id": group_id, "client-id": client_id} data_raw = self.raw_get(URL_ADMIN_GROUPS_CLIENT_ROLES.format(**params_path)) return raise_error_from_response(data_raw, KeycloakGetError) - def get_group_client_roles(self, group_id, client_id, roles): + def delete_group_client_roles(self, group_id, client_id, roles): """ - Get client roles of a group + Delete client roles of a group :param group_id: id of group :param client_id: id of client (not client-id) From 70b9efeaa30017208bd1b641637ff051142f6b21 Mon Sep 17 00:00:00 2001 From: rpisani5c <55719539+rpisani5c@users.noreply.github.com> Date: Tue, 27 Oct 2020 12:36:42 -0500 Subject: [PATCH 2/2] Update keycloak_admin.py Removed the roles param definition on the get_group_client_roles method. --- keycloak/keycloak_admin.py | 1 - 1 file changed, 1 deletion(-) diff --git a/keycloak/keycloak_admin.py b/keycloak/keycloak_admin.py index 53ddab4..6356cfe 100644 --- a/keycloak/keycloak_admin.py +++ b/keycloak/keycloak_admin.py @@ -1078,7 +1078,6 @@ class KeycloakAdmin: :param group_id: id of group :param client_id: id of client (not client-id) - :param roles: roles list or role (use GroupRoleRepresentation) :return Keycloak server response """