diff options
author | 2020-09-25 19:57:00 +0530 | |
---|---|---|
committer | 2020-10-19 22:19:56 +0530 | |
commit | 624d127c04a338f407da810b0049d241e5ddee9d (patch) | |
tree | db76ac14bd1d81b54706f8a53ff3cf39ac7269cd /opnfv_testapi/resources | |
parent | f4372970fdb57b851ce52d6ca15e027f88558809 (diff) |
Added memcache for token validation
Issue-ID: DOVETAIL-801
Signed-off-by: Kanagaraj Manickam <kanagaraj.manickam@huawei.com>
Change-Id: I4503cb02fe146f92e3d5d08f123628900522335b
Diffstat (limited to 'opnfv_testapi/resources')
-rw-r--r-- | opnfv_testapi/resources/result_handlers.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/opnfv_testapi/resources/result_handlers.py b/opnfv_testapi/resources/result_handlers.py index ad0b37c..df8b988 100644 --- a/opnfv_testapi/resources/result_handlers.py +++ b/opnfv_testapi/resources/result_handlers.py @@ -398,9 +398,10 @@ class ResultsFileUploadHandler(ResultsCLHandler): @raise 404: pod/project/testcase not exist @raise 400: body/pod_name/project_name/case_name not provided """ - token = self.get_secure_cookie("token") + mc = memcache.Client(['127.0.0.1:11211'], debug=0) + token = mc.get("token") input_token = self.request.headers._dict['Token'] - if not input_token or not input_token == token: + if not token or not input_token == token: raises.Unauthorized(message.invalid_token()) file_array = self.request.files.get('file', None) if file_array is None: |