diff options
author | Kanagaraj Manickam <kanagaraj.manickam@huawei.com> | 2020-09-25 16:00:39 +0530 |
---|---|---|
committer | Kanagaraj Manickam <kanagaraj.manickam@huawei.com> | 2020-10-19 22:19:56 +0530 |
commit | 5e2e95719f26f54db9ecf28847c36098b253b290 (patch) | |
tree | a9bc1f60860c2d299b239d91844669f186efebbc /opnfv_testapi | |
parent | a94ce6ef25704af2431f8a2ff720f4a4e4fb300e (diff) |
Added Mem-cache for storing token
Issue-ID: DOVETAIL-801
Signed-off-by: Kanagaraj Manickam <kanagaraj.manickam@huawei.com>
Change-Id: Ia3a3683a6e635c86447ca6bd96c7416d73febf7d
Diffstat (limited to 'opnfv_testapi')
-rw-r--r-- | opnfv_testapi/ui/auth/sign.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/opnfv_testapi/ui/auth/sign.py b/opnfv_testapi/ui/auth/sign.py index 9652364..0667227 100644 --- a/opnfv_testapi/ui/auth/sign.py +++ b/opnfv_testapi/ui/auth/sign.py @@ -27,6 +27,7 @@ import logging import oauth2 as oauth import requests import json +import memcache root = logging.getLogger() root.setLevel(logging.DEBUG) @@ -316,6 +317,8 @@ class LoginHandler(base.BaseHandler): raises.Unauthorized(message.invalid_credentials()) # generate random token token = base.get_token() - self.set_secure_cookie("token", token) resp = {'status': 'success'} - self.finish_request(resp) + mc = memcache.Client(['127.0.0.1:11211'], debug=0) + mc.set("token", token) + self.set_header("token", token) + self.finish_request(response) |