Skip to content
Snippets Groups Projects
Commit e897c6c7 authored by Chris Hines's avatar Chris Hines
Browse files

add an endpoint to set the cookie for transfering to a different client

parent cb5dd9c2
No related branches found
No related tags found
3 merge requests!77Revert "disable agressive kill and restart",!64Test,!63Dev
Pipeline #16322 passed
......@@ -434,6 +434,7 @@ class AppUrl(Resource):
appdef = json.loads(request.args.get('app'))
inst = json.loads(request.args.get('appinst'))
inst['twsproxy']='{twsproxy}'
inst['twsproxyauth'] = request.cookies.get('twsproxyauth')
url = "{}/{}".format("{twsproxy}",appdef['client']['redir'].format(**inst))
return url
except Exception as e:
......@@ -443,6 +444,15 @@ class AppUrl(Resource):
#flask_restful.abort(500,message="AppUrl failed in some unexpected way")
return apiabort(500,message="AppUrl failed in some unexpected way")
class SetTWSProxyAuth(Resource):
def get(self, authtok):
import urllib.parse
url = urllib.parse.unquote(request.args.get(redirect))
response = make_response(redirect(url))
response.set_cookie('twsproxyauth', authtok, secure=True)
return response
class Ping(Resource):
def get(self):
return None, 201
......@@ -564,6 +574,7 @@ api.add_resource(GetCert, '/getcert')
api.add_resource(JobStat, '/stat')
api.add_resource(Ping, '/ping')
api.add_resource(JobCancel, '/cancel/<int:jobid>')
api.add_resource(SetTWSProxyAuth, '/settwsproxyauth/<string:authtok>')
api.add_resource(JobSubmit, '/submit')
api.add_resource(CreateTunnel, '/createtunnel/<string:username>/<string:loginhost>/<string:batchhost>')
api.add_resource(AppInstance, '/appinstance/<string:username>/<string:loginhost>/<string:batchhost>/<int:jobid>')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment