mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge pull request #27271 from isbm/isbm-bufix-27270
Bugfix: crash on token authentication via API
This commit is contained in:
commit
c0943dd4d1
@ -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
|
# If there are groups in the token, check if any of them are listed in the eauth config
|
||||||
group_auth_match = False
|
group_auth_match = False
|
||||||
try:
|
try:
|
||||||
for group in token['groups']:
|
if token.get('groups'):
|
||||||
if group in eauth_groups:
|
for group in token['groups']:
|
||||||
group_auth_match = True
|
if group in eauth_groups:
|
||||||
break
|
group_auth_match = True
|
||||||
|
break
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
if '*' not in eauth_users and token['name'] not in eauth_users and not group_auth_match:
|
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