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

Function create_user_report

examples/complete_user_report.py:22–43  ·  view source on GitHub ↗
(params)

Source from the content-addressed store, hash-verified

20
21
22def create_user_report(params): # type: (KeeperParams) -> Optional[str]
23 user_report = UserReportCommand()
24 user_report_data = user_report.execute(params, format='json')
25 data = json.loads(user_report_data)
26 users = {x['email']: x for x in data}
27 security_audit_report = SecurityAuditReportCommand()
28 security_audit_report_data = security_audit_report.execute(params, format='json')
29 if security_audit_report_data:
30 data = json.loads(security_audit_report_data)
31 for x in data:
32 if 'email' in x:
33 email = x['email']
34 if email in users:
35 user = users[email]
36 for key in x:
37 if key not in user:
38 if key not in ('node_path', 'username'):
39 user[key] = x[key]
40 else:
41 users[email] = x
42
43 return json.dumps(list(users.values()), indent=2)
44
45
46def lambda_handler(event, context):

Callers 2

lambda_handlerFunction · 0.85

Calls 4

executeMethod · 0.95
executeMethod · 0.95
UserReportCommandClass · 0.90

Tested by

no test coverage detected