Browse Source

fix: fixed bugs in events methods

pull/327/head
Richard Nemeth 3 years ago
parent
commit
e95649a93c
No known key found for this signature in database GPG Key ID: 21C39470DF3DEC39
  1. 3
      src/keycloak/keycloak_admin.py
  2. 1
      src/keycloak/urls_patterns.py

3
src/keycloak/keycloak_admin.py

@ -2551,6 +2551,7 @@ class KeycloakAdmin:
:return: events list :return: events list
""" """
query = query or dict()
params_path = {"realm-name": self.realm_name} params_path = {"realm-name": self.realm_name}
data_raw = self.raw_get( data_raw = self.raw_get(
urls_patterns.URL_ADMIN_EVENTS.format(**params_path), data=None, **query urls_patterns.URL_ADMIN_EVENTS.format(**params_path), data=None, **query
@ -2568,7 +2569,7 @@ class KeycloakAdmin:
""" """
params_path = {"realm-name": self.realm_name} params_path = {"realm-name": self.realm_name}
data_raw = self.raw_put( 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]) return raise_error_from_response(data_raw, KeycloakPutError, expected_codes=[204])

1
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 = "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" URL_ADMIN_CLIENT_SESSION_STATS = "admin/realms/{realm-name}/client-session-stats"
Loading…
Cancel
Save