Browse Source

fix: fixed components bugs

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

9
src/keycloak/keycloak_admin.py

@ -2461,6 +2461,7 @@ class KeycloakAdmin:
:param query: Query parameters (optional) :param query: Query parameters (optional)
:return: components list :return: components 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_COMPONENTS.format(**params_path), data=None, **query urls_patterns.URL_ADMIN_COMPONENTS.format(**params_path), data=None, **query
@ -2475,15 +2476,15 @@ class KeycloakAdmin:
https://www.keycloak.org/docs-api/18.0/rest-api/index.html#_componentrepresentation https://www.keycloak.org/docs-api/18.0/rest-api/index.html#_componentrepresentation
:param payload: ComponentRepresentation :param payload: ComponentRepresentation
:return: UserRepresentation
:return: Component id
""" """
params_path = {"realm-name": self.realm_name} params_path = {"realm-name": self.realm_name}
data_raw = self.raw_post( data_raw = self.raw_post(
urls_patterns.URL_ADMIN_COMPONENTS.format(**params_path), data=json.dumps(payload) urls_patterns.URL_ADMIN_COMPONENTS.format(**params_path), data=json.dumps(payload)
) )
return raise_error_from_response(data_raw, KeycloakPostError, expected_codes=[201])
raise_error_from_response(data_raw, KeycloakPostError, expected_codes=[201])
_last_slash_idx = data_raw.headers["Location"].rindex("/")
return data_raw.headers["Location"][_last_slash_idx + 1 :] # noqa: E203
def get_component(self, component_id): def get_component(self, component_id):
""" """

Loading…
Cancel
Save