@@ -2216,6 +2216,33 @@ def get_client_authz_settings(self, client_id: str) -> dict:
22162216 )
22172217 return raise_error_from_response (data_raw , KeycloakGetError )
22182218
2219+ def import_client_authz_config (self , client_id : str , payload : dict ) -> dict :
2220+ """
2221+ Import client authorization configuration.
2222+
2223+ ResourceServerRepresentation
2224+ https://www.keycloak.org/docs-api/latest/rest-api/index.html#ResourceServerRepresentation
2225+
2226+ :param client_id: id in ClientRepresentation
2227+ https://www.keycloak.org/docs-api/24.0.2/rest-api/index.html#_clientrepresentation
2228+ :type client_id: str
2229+ :param payload: ResourceServerRepresentation
2230+ :type payload: dict
2231+
2232+ :return: None
2233+ """
2234+ params_path = {"realm-name" : self .connection .realm_name , "id" : client_id }
2235+ data_raw = self .connection .raw_post (
2236+ urls_patterns .URL_ADMIN_CLIENT_AUTHZ_IMPORT .format (** params_path ),
2237+ data = json .dumps (payload ),
2238+ )
2239+
2240+ return raise_error_from_response (
2241+ data_raw ,
2242+ KeycloakPostError ,
2243+ expected_codes = [HTTP_NO_CONTENT ],
2244+ )
2245+
22192246 def create_client_authz_resource (
22202247 self ,
22212248 client_id : str ,
@@ -7527,6 +7554,33 @@ async def a_get_client_authz_settings(self, client_id: str) -> dict:
75277554 )
75287555 return raise_error_from_response (data_raw , KeycloakGetError )
75297556
7557+ async def a_import_client_authz_config (self , client_id : str , payload : dict ) -> dict :
7558+ """
7559+ Import client authorization configuration asynchronously.
7560+
7561+ ResourceServerRepresentation
7562+ https://www.keycloak.org/docs-api/latest/rest-api/index.html#ResourceServerRepresentation
7563+
7564+ :param client_id: id in ClientRepresentation
7565+ https://www.keycloak.org/docs-api/24.0.2/rest-api/index.html#_clientrepresentation
7566+ :type client_id: str
7567+ :param payload: ResourceServerRepresentation
7568+ :type payload: dict
7569+
7570+ :return: None
7571+ """
7572+ params_path = {"realm-name" : self .connection .realm_name , "id" : client_id }
7573+ data_raw = await self .connection .a_raw_post (
7574+ urls_patterns .URL_ADMIN_CLIENT_AUTHZ_IMPORT .format (** params_path ),
7575+ data = json .dumps (payload ),
7576+ )
7577+
7578+ return raise_error_from_response (
7579+ data_raw ,
7580+ KeycloakPostError ,
7581+ expected_codes = [HTTP_NO_CONTENT ],
7582+ )
7583+
75307584 async def a_create_client_authz_resource (
75317585 self ,
75327586 client_id : str ,
0 commit comments