Pass eauth user/groups through salt-api to destination functions

This commit is contained in:
Colton Myers 2016-03-24 15:08:01 -06:00
parent 939c1b17d5
commit 40f7e596d8

View file

@ -758,6 +758,10 @@ class LowDataAdapter(object):
for chunk in lowstate:
if token:
chunk['token'] = token
if cherrypy.session.get('user'):
chunk['__user__'] = cherrypy.session.get('user')
if cherrypy.session.get('groups'):
chunk['__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: