wip
This commit is contained in:
parent
c1623595de
commit
6dd7199518
1 changed files with 6 additions and 9 deletions
|
@ -16,17 +16,14 @@ def authorized_usersuser(metadata):
|
||||||
users = {}
|
users = {}
|
||||||
|
|
||||||
for name, config in metadata.get('users').items():
|
for name, config in metadata.get('users').items():
|
||||||
|
users[name] = {
|
||||||
|
'authorized_keys': [],
|
||||||
|
}
|
||||||
for authorized_user in config.get('authorized_users', []):
|
for authorized_user in config.get('authorized_users', []):
|
||||||
authorized_user_name, authorized_user_node = authorized_user.split('@')
|
authorized_user_name, authorized_user_node = authorized_user.split('@')
|
||||||
users\
|
users[name]['authorized_keys'].append(
|
||||||
.setdefault(name, {})\
|
repo.get_node(authorized_user_node).metadata.get(f'users/{authorized_user_name}/pubkey')
|
||||||
.setdefault('authorized_keys', [])\
|
)
|
||||||
.append(
|
|
||||||
repo\
|
|
||||||
.get_node(authorized_user_node)\
|
|
||||||
.metadata\
|
|
||||||
.get(f'users/{authorized_user_name}/pubkey')
|
|
||||||
)
|
|
||||||
return {
|
return {
|
||||||
'users': users,
|
'users': users,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue