mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Fix the crash on token auth via API (http://git.io/vn4tx)
This commit is contained in:
parent
de6e5abe6c
commit
3152af78b5
@ -1779,10 +1779,11 @@ class ClearFuncs(object):
|
||||
# If there are groups in the token, check if any of them are listed in the eauth config
|
||||
group_auth_match = False
|
||||
try:
|
||||
for group in token['groups']:
|
||||
if group in eauth_groups:
|
||||
group_auth_match = True
|
||||
break
|
||||
if token.get('groups') in [False, None]:
|
||||
for group in token['groups']:
|
||||
if group in eauth_groups:
|
||||
group_auth_match = True
|
||||
break
|
||||
except KeyError:
|
||||
pass
|
||||
if '*' not in eauth_users and token['name'] not in eauth_users and not group_auth_match:
|
||||
|
Loading…
Reference in New Issue
Block a user