From e95649a93ce7c058ca60b38f41fa65ff441c55ef Mon Sep 17 00:00:00 2001 From: Richard Nemeth Date: Fri, 27 May 2022 22:10:12 +0200 Subject: [PATCH] fix: fixed bugs in events methods --- src/keycloak/keycloak_admin.py | 3 ++- src/keycloak/urls_patterns.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/keycloak/keycloak_admin.py b/src/keycloak/keycloak_admin.py index ab0dad6..d754cd4 100644 --- a/src/keycloak/keycloak_admin.py +++ b/src/keycloak/keycloak_admin.py @@ -2551,6 +2551,7 @@ class KeycloakAdmin: :return: events list """ + query = query or dict() params_path = {"realm-name": self.realm_name} data_raw = self.raw_get( urls_patterns.URL_ADMIN_EVENTS.format(**params_path), data=None, **query @@ -2568,7 +2569,7 @@ class KeycloakAdmin: """ params_path = {"realm-name": self.realm_name} data_raw = self.raw_put( - urls_patterns.URL_ADMIN_EVENTS.format(**params_path), data=json.dumps(payload) + urls_patterns.URL_ADMIN_EVENTS_CONFIG.format(**params_path), data=json.dumps(payload) ) return raise_error_from_response(data_raw, KeycloakPutError, expected_codes=[204]) diff --git a/src/keycloak/urls_patterns.py b/src/keycloak/urls_patterns.py index 071c733..d836ed4 100644 --- a/src/keycloak/urls_patterns.py +++ b/src/keycloak/urls_patterns.py @@ -166,4 +166,5 @@ URL_ADMIN_USER_FEDERATED_IDENTITY = ( ) URL_ADMIN_EVENTS = "admin/realms/{realm-name}/events" +URL_ADMIN_EVENTS_CONFIG = URL_ADMIN_EVENTS + "/config" URL_ADMIN_CLIENT_SESSION_STATS = "admin/realms/{realm-name}/client-session-stats"