mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #32133 from basepi/api_user_passthrough
Pass eauth user/groups through salt-api to destination functions
This commit is contained in:
commit
245249d347
1 changed files with 7 additions and 0 deletions
|
@ -758,6 +758,10 @@ class LowDataAdapter(object):
|
|||
for chunk in lowstate:
|
||||
if token:
|
||||
chunk['token'] = token
|
||||
if cherrypy.session.get('user'):
|
||||
chunk['__current_eauth_user'] = cherrypy.session.get('user')
|
||||
if cherrypy.session.get('groups'):
|
||||
chunk['__current_eauth_groups'] = cherrypy.session.get('groups')
|
||||
|
||||
if client:
|
||||
chunk['client'] = client
|
||||
|
@ -1499,6 +1503,9 @@ class Login(LowDataAdapter):
|
|||
cherrypy.response.headers['X-Auth-Token'] = cherrypy.session.id
|
||||
cherrypy.session['token'] = token['token']
|
||||
cherrypy.session['timeout'] = (token['expire'] - token['start']) / 60
|
||||
cherrypy.session['user'] = token['name']
|
||||
if 'groups' in token:
|
||||
cherrypy.session['groups'] = token['groups']
|
||||
|
||||
# Grab eauth config for the current backend for the current user
|
||||
try:
|
||||
|
|
Loading…
Add table
Reference in a new issue