feat: mongodb accounts gather

pull/14592/head
wangruidong 2024-12-03 17:42:56 +08:00 committed by w940853815
parent c658252c01
commit 0adb9e0d5e
1 changed files with 16 additions and 0 deletions

View File

@ -213,6 +213,22 @@ class GatherAccountsFilter:
result[user['username']] = user
return result
@staticmethod
def mongodb_filter(info):
result = {}
for db, users in info.items():
for username, user_info in users.items():
user = {
'username': username,
'date_password_change': None,
'date_password_expired': None,
'date_last_login': None,
'groups': '',
}
result['detail'] = {'db': db, 'roles': user_info.get('roles', [])}
result[username] = user
return result
def run(self, method_id_meta_mapper, info):
run_method_name = None
for k, v in method_id_meta_mapper.items():