diff --git a/keepercommander/commands/scim.py b/keepercommander/commands/scim.py index 9fd6a9bfd..4a379fab7 100644 --- a/keepercommander/commands/scim.py +++ b/keepercommander/commands/scim.py @@ -152,12 +152,22 @@ def execute(self, params, node=None, **kwargs): api.communicate(params, rq) api.query_enterprise(params) + scim_url = get_scim_url(params, matched_node['node_id']) + node_id = matched_node['node_id'] logging.info('') logging.info('SCIM ID: %d', rq['scim_id']) - logging.info('SCIM URL: %s', get_scim_url(params, matched_node['node_id'])) + logging.info('SCIM URL: %s', scim_url) logging.info('Provisioning Token: %s', token) logging.info('') - return token + return { + 'scim_id': rq['scim_id'], + 'scim_url': scim_url, + 'provisioning_token': token, + 'node_name': self.get_node_path(params, node_id), + 'node_id': node_id, + 'prefix': prefix or '', + 'unique_groups': kwargs.get('unique_groups', '') == 'on', + } def find_scim(param, name): # type: (KeeperParams, any) -> dict @@ -243,12 +253,23 @@ def execute(self, params, target=None, **kwargs): api.communicate(params, rq) api.query_enterprise(params) + node_id = scim['node_id'] + scim_url = get_scim_url(params, node_id) + updated = find_scim(params, str(scim['scim_id'])) logging.info('') logging.info('SCIM ID: %d', scim['scim_id']) - logging.info('SCIM URL: %s', get_scim_url(params, scim['node_id'])) + logging.info('SCIM URL: %s', scim_url) logging.info('Provisioning Token: %s', token) logging.info('') - return token + return { + 'scim_id': scim['scim_id'], + 'scim_url': scim_url, + 'provisioning_token': token, + 'node_name': self.get_node_path(params, node_id), + 'node_id': node_id, + 'prefix': updated.get('role_prefix') or '', + 'unique_groups': updated.get('unique_groups', False), + } class ScimDeleteCommand(EnterpriseCommand): diff --git a/keepercommander/service/util/parse_keeper_response.py b/keepercommander/service/util/parse_keeper_response.py index 7f8f004f1..232b0f8f6 100644 --- a/keepercommander/service/util/parse_keeper_response.py +++ b/keepercommander/service/util/parse_keeper_response.py @@ -118,6 +118,13 @@ def parse_response(command: str, response: Any, log_output: str = None) -> Dict[ Returns: Dict[str, Any]: Structured JSON response """ + if isinstance(response, dict) and 'status' not in response: + base_cmd = ' '.join(command.split()[:2]) if len(command.split()) >= 2 else command.split()[0] + return { + "status": "success", + "command": base_cmd, + "data": response, + } # Preprocess response once response_str, is_from_log = KeeperResponseParser._preprocess_response(response, log_output)