summaryrefslogtreecommitdiffstats
path: root/utils/test/testapi/opnfv_testapi/common/check.py
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2017-09-07 16:18:56 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2017-09-12 10:08:13 +0800
commit02e8765db17f2a28ef04aa28d10a3b28ad5eeb3f (patch)
treefb0a204ae135745904d9b23d70c05636aa626322 /utils/test/testapi/opnfv_testapi/common/check.py
parentc7f40696b6223a945d38634e423ebcb2888d98fd (diff)
leverage token_check only when posting results
In this patch begin to consider the LFID authentication, token check only effects results, the permission of other resources(pods/projects...) will be checked by LFID. Change-Id: I20f6f221e3bd75ebf06dcd91012898b913f1d0be Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'utils/test/testapi/opnfv_testapi/common/check.py')
-rw-r--r--utils/test/testapi/opnfv_testapi/common/check.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/utils/test/testapi/opnfv_testapi/common/check.py b/utils/test/testapi/opnfv_testapi/common/check.py
index acd331784..9ded48dd4 100644
--- a/utils/test/testapi/opnfv_testapi/common/check.py
+++ b/utils/test/testapi/opnfv_testapi/common/check.py
@@ -10,19 +10,16 @@ import functools
import re
from tornado import gen
-from tornado import web
from opnfv_testapi.common import message
from opnfv_testapi.common import raises
from opnfv_testapi.db import api as dbapi
-def authenticate(method):
- @web.asynchronous
- @gen.coroutine
+def valid_token(method):
@functools.wraps(method)
def wrapper(self, *args, **kwargs):
- if self.auth:
+ if self.auth and self.table == 'results':
try:
token = self.request.headers['X-Auth-Token']
except KeyError: