mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #4217 from whiteinge/fix-token-auth
Fix wheel token auth by moving eauth checks below token
This commit is contained in:
commit
9d9c62d186
@ -1539,18 +1539,6 @@ class ClearFuncs(object):
|
||||
Send a master control function back to the wheel system
|
||||
'''
|
||||
# All wheel ops pass through eauth
|
||||
if not 'eauth' in clear_load:
|
||||
msg = ('Authentication failure of type "eauth" occurred for '
|
||||
'user {0}.').format(clear_load.get('username', 'UNKNOWN'))
|
||||
log.warning(msg)
|
||||
return ''
|
||||
if not clear_load['eauth'] in self.opts['external_auth']:
|
||||
# The eauth system is not enabled, fail
|
||||
msg = ('Authentication failure of type "eauth" occurred for '
|
||||
'user {0}.').format(clear_load.get('username', 'UNKNOWN'))
|
||||
log.warning(msg)
|
||||
return ''
|
||||
|
||||
if 'token' in clear_load:
|
||||
try:
|
||||
token = self.loadauth.get_tok(clear_load['token'])
|
||||
@ -1574,6 +1562,18 @@ class ClearFuncs(object):
|
||||
clear_load.pop('fun'),
|
||||
**clear_load)
|
||||
|
||||
if not 'eauth' in clear_load:
|
||||
msg = ('Authentication failure of type "eauth" occurred for '
|
||||
'user {0}.').format(clear_load.get('username', 'UNKNOWN'))
|
||||
log.warning(msg)
|
||||
return ''
|
||||
if not clear_load['eauth'] in self.opts['external_auth']:
|
||||
# The eauth system is not enabled, fail
|
||||
msg = ('Authentication failure of type "eauth" occurred for '
|
||||
'user {0}.').format(clear_load.get('username', 'UNKNOWN'))
|
||||
log.warning(msg)
|
||||
return ''
|
||||
|
||||
try:
|
||||
name = self.loadauth.load_name(clear_load)
|
||||
if not name in self.opts['external_auth'][clear_load['eauth']]:
|
||||
|
Loading…
Reference in New Issue
Block a user