mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Add safety to auth
This commit is contained in:
parent
01c3e3986b
commit
7ad4210ed1
@ -40,6 +40,11 @@ class LoadAuth(object):
|
||||
Return the primary name associate with the load, if an empty string
|
||||
is returned then the load does not match the function
|
||||
'''
|
||||
if not 'fun' in load:
|
||||
return ''
|
||||
fstr = '{0}.auth'.format(load['fun'])
|
||||
if not fstr in self.auth:
|
||||
return ''
|
||||
fcall = salt.utils.format_call(self.auth[fstr], load)
|
||||
try:
|
||||
return fcall['args'][0]
|
||||
|
Loading…
Reference in New Issue
Block a user