From 3a45fa5d4e55b4cb3685db6726a819f8972f3d64 Mon Sep 17 00:00:00 2001 From: Marcos Pereira Date: Sun, 16 Aug 2020 12:09:16 -0300 Subject: [PATCH] Release version 0.22.0 --- docs/source/conf.py | 4 ++-- keycloak/keycloak_admin.py | 21 ++++++++++----------- setup.py | 2 +- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index b09b16b..96f7777 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -60,9 +60,9 @@ author = 'Marcos Pereira' # built documents. # # The short X.Y version. -version = '0.21.0' +version = '0.22.0' # The full version, including alpha/beta/rc tags. -release = '0.21.0' +release = '0.22.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/keycloak/keycloak_admin.py b/keycloak/keycloak_admin.py index 2f0b03a..ae443b6 100644 --- a/keycloak/keycloak_admin.py +++ b/keycloak/keycloak_admin.py @@ -29,7 +29,7 @@ from builtins import isinstance from typing import List, Iterable from keycloak.urls_patterns import URL_ADMIN_GROUPS_REALM_ROLES, \ - URL_ADMIN_GET_GROUPS_REALM_ROLES, URL_ADMIN_REALM_ROLES_ROLE_BY_NAME + URL_ADMIN_GET_GROUPS_REALM_ROLES, URL_ADMIN_REALM_ROLES_ROLE_BY_NAME, URL_ADMIN_GROUPS_CLIENT_ROLES from .connection import ConnectionManager from .exceptions import raise_error_from_response, KeycloakGetError from .keycloak_openid import KeycloakOpenID @@ -194,7 +194,6 @@ class KeycloakAdmin: self._auto_refresh_token = value - def __fetch_all(self, url, query=None): '''Wrapper function to paginate GET requests @@ -280,7 +279,7 @@ class KeycloakAdmin: params_path = {"realm-name": realm_name} data_raw = self.raw_put(URL_ADMIN_REALM.format(**params_path), data=json.dumps(payload)) - return raise_error_from_response(data_raw, KeycloakGetError, expected_code=204) + return raise_error_from_response(data_raw, KeycloakGetError, expected_codes=[204]) def delete_realm(self, realm_name): """ @@ -292,7 +291,7 @@ class KeycloakAdmin: params_path = {"realm-name": realm_name} data_raw = self.raw_delete(URL_ADMIN_REALM.format(**params_path)) - return raise_error_from_response(data_raw, KeycloakGetError, expected_code=204) + return raise_error_from_response(data_raw, KeycloakGetError, expected_codes=[204]) def get_users(self, query=None): """ @@ -986,7 +985,7 @@ class KeycloakAdmin: params_path = {"realm-name": self.realm_name, "role-name": role_name} data_raw = self.connection.raw_put(URL_ADMIN_REALM_ROLES_ROLE_BY_NAME.format(**params_path), data=json.dumps(payload)) - return raise_error_from_response(data_raw, KeycloakGetError, expected_code=204) + return raise_error_from_response(data_raw, KeycloakGetError, expected_codes=[204]) def delete_realm_role(self, role_name): """ @@ -998,7 +997,7 @@ class KeycloakAdmin: params_path = {"realm-name": self.realm_name, "role-name": role_name} data_raw = self.connection.raw_delete( URL_ADMIN_REALM_ROLES_ROLE_BY_NAME.format(**params_path)) - return raise_error_from_response(data_raw, KeycloakGetError, expected_code=204) + return raise_error_from_response(data_raw, KeycloakGetError, expected_codes=[204]) def assign_realm_roles(self, user_id, client_id, roles): """ @@ -1071,7 +1070,7 @@ class KeycloakAdmin: params_path = {"realm-name": self.realm_name, "id": group_id, "client-id": client_id} data_raw = self.raw_post(URL_ADMIN_GROUPS_CLIENT_ROLES.format(**params_path), data=json.dumps(payload)) - return raise_error_from_response(data_raw, KeycloakGetError, expected_code=204) + return raise_error_from_response(data_raw, KeycloakGetError, expected_codes=[204]) def delete_group_client_roles(self, group_id, client_id, roles): """ @@ -1102,7 +1101,7 @@ class KeycloakAdmin: params_path = {"realm-name": self.realm_name, "id": group_id, "client-id": client_id} data_raw = self.raw_delete(URL_ADMIN_GROUPS_CLIENT_ROLES.format(**params_path), data=json.dumps(payload)) - return raise_error_from_response(data_raw, KeycloakGetError, expected_code=204) + return raise_error_from_response(data_raw, KeycloakGetError, expected_codes=[204]) def get_client_roles_of_user(self, user_id, client_id): """ @@ -1328,7 +1327,7 @@ class KeycloakAdmin: data_raw = self.raw_post(URL_ADMIN_COMPONENTS.format(**params_path), data=json.dumps(payload)) - return raise_error_from_response(data_raw, KeycloakGetError, expected_code=201) + return raise_error_from_response(data_raw, KeycloakGetError, expected_codes=[201]) def get_component(self, component_id): """ @@ -1358,7 +1357,7 @@ class KeycloakAdmin: params_path = {"realm-name": self.realm_name, "component-id": component_id} data_raw = self.raw_put(URL_ADMIN_COMPONENT.format(**params_path), data=json.dumps(payload)) - return raise_error_from_response(data_raw, KeycloakGetError, expected_code=204) + return raise_error_from_response(data_raw, KeycloakGetError, expected_codes=[204]) def delete_component(self, component_id): """ @@ -1370,7 +1369,7 @@ class KeycloakAdmin: """ params_path = {"realm-name": self.realm_name, "component-id": component_id} data_raw = self.raw_delete(URL_ADMIN_COMPONENT.format(**params_path)) - return raise_error_from_response(data_raw, KeycloakGetError, expected_code=204) + return raise_error_from_response(data_raw, KeycloakGetError, expected_codes=[204]) def get_keys(self): """ diff --git a/setup.py b/setup.py index acf6187..9467d53 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ with open("README.md", "r") as fh: setup( name='python-keycloak', - version='0.21.0', + version='0.22.0', url='https://github.com/marcospereirampj/python-keycloak', license='The MIT License', author='Marcos Pereira',