Skip to content
Permalink
Browse files

⚡️ add the ability to get a public token

  • Loading branch information...
trojikman committed Jun 5, 2019
1 parent 285ed7b commit 0a3d271e375bb77ecf7a4256637e31d8c156ee8a
Showing with 11 additions and 2 deletions.
  1. +6 −2 auth_quick/controllers/main.py
  2. +5 −0 auth_quick/doc/changelog.rst
@@ -1,4 +1,5 @@
# Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# Copyright 2019 Denis Mudarisov <https://it-projects.info/team/trojikman>
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
import json
import requests
@@ -23,7 +24,7 @@ def get_build_url(self):
return parsed.scheme + "://" + parsed.netloc

@http.route('/auth_quick/login', type="http", auth='public')
def login(self, build_login=None, build_user_id=None):
def login(self, build_login=None, build_user_id=None, public_token=None):
if not (build_login or build_user_id):
return "Wrong args"

@@ -44,7 +45,10 @@ def login(self, build_login=None, build_user_id=None):
'build_user_id': build_user_id,
'build_url': build_url,
})
url = urllib.parse.urljoin(master_url, '/auth_quick_master/get-token?%s' % params)
if public_token:
url = urllib.parse.urljoin(master_url, '/auth_quick_master/get-public-token?%s' % params)
else:
url = urllib.parse.urljoin(master_url, '/auth_quick_master/get-token?%s' % params)

return werkzeug.utils.redirect(url, 302)

@@ -1,3 +1,8 @@
`1.0.1`
-------

- **Improvement:** add the ability to gain public access to the build for demonstration purposes, etc.

`1.0.0`
-------

0 comments on commit 0a3d271

Please sign in to comment.
You can’t perform that action at this time.