MCPcopy Create free account
hub / github.com/Keeper-Security/Commander / execute

Method execute

keepercommander/commands/scim.py:246–279  ·  view source on GitHub ↗
(self, params, target=None, **kwargs)

Source from the content-addressed store, hash-verified

244 return scim_edit_parser
245
246 def execute(self, params, target=None, **kwargs):
247 scim = find_scim(params, target)
248 token = base64.urlsafe_b64encode(os.urandom(32)).decode().rstrip('=')
249 rq = {
250 'command': 'scim_update',
251 'scim_id': scim['scim_id'],
252 'token': token,
253 }
254 prefix = kwargs.get('prefix')
255 if prefix:
256 rq['prefix'] = prefix
257 unique_groups = kwargs.get('unique_groups')
258 if unique_groups:
259 rq['unique_groups'] = unique_groups == 'on'
260
261 api.communicate(params, rq)
262 api.query_enterprise(params)
263 node_id = scim['node_id']
264 scim_url = get_scim_url(params, node_id)
265 updated = find_scim(params, str(scim['scim_id']))
266 logging.info('')
267 logging.info('SCIM ID: %d', scim['scim_id'])
268 logging.info('SCIM URL: %s', scim_url)
269 logging.info('Provisioning Token: %s', token)
270 logging.info('')
271 return {
272 'scim_id': scim['scim_id'],
273 'scim_url': scim_url,
274 'provisioning_token': token,
275 'node_name': self.get_node_path(params, node_id),
276 'node_id': node_id,
277 'prefix': updated.get('role_prefix') or '',
278 'unique_groups': updated.get('unique_groups', False),
279 }
280
281
282class ScimDeleteCommand(EnterpriseCommand):

Callers

nothing calls this directly

Calls 7

find_scimFunction · 0.85
get_scim_urlFunction · 0.85
communicateMethod · 0.80
get_node_pathMethod · 0.80
getMethod · 0.45
query_enterpriseMethod · 0.45
infoMethod · 0.45

Tested by

no test coverage detected