summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/ui/auth/base.py
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2017-08-30 11:59:46 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2017-08-31 10:43:14 +0800
commit9e36409f1bf52a6fd510c4f4896d85761b59cfa9 (patch)
treeb5917ad3530efb2856a9a398a78cb7fca3af9e2e /testapi/opnfv_testapi/ui/auth/base.py
parentea7706279a99c03181c348d29c157f70037ed217 (diff)
leverage LFID as Authentication
delete openid authentication add LFID authentication Change-Id: Iead144b5130bce51448024e65092fdea3bb2f07a Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'testapi/opnfv_testapi/ui/auth/base.py')
-rw-r--r--testapi/opnfv_testapi/ui/auth/base.py35
1 files changed, 0 insertions, 35 deletions
diff --git a/testapi/opnfv_testapi/ui/auth/base.py b/testapi/opnfv_testapi/ui/auth/base.py
deleted file mode 100644
index bea87c4..0000000
--- a/testapi/opnfv_testapi/ui/auth/base.py
+++ /dev/null
@@ -1,35 +0,0 @@
-import random
-import string
-
-from six.moves.urllib import parse
-
-from opnfv_testapi.resources import handlers
-
-
-class BaseHandler(handlers.GenericApiHandler):
- def __init__(self, application, request, **kwargs):
- super(BaseHandler, self).__init__(application, request, **kwargs)
- self.table = 'users'
-
- def set_cookies(self, cookies):
- for cookie_n, cookie_v in cookies:
- self.set_secure_cookie(cookie_n, cookie_v)
-
-
-def get_token(length=30):
- """Get random token."""
- return ''.join(random.choice(string.ascii_lowercase)
- for i in range(length))
-
-
-def set_query_params(url, params):
- """Set params in given query."""
- url_parts = parse.urlparse(url)
- url = parse.urlunparse((
- url_parts.scheme,
- url_parts.netloc,
- url_parts.path,
- url_parts.params,
- parse.urlencode(params),
- url_parts.fragment))
- return url