From 02e8765db17f2a28ef04aa28d10a3b28ad5eeb3f Mon Sep 17 00:00:00 2001 From: SerenaFeng Date: Thu, 7 Sep 2017 16:18:56 +0800 Subject: 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 --- utils/test/testapi/opnfv_testapi/common/check.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'utils/test/testapi/opnfv_testapi/common/check.py') 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: -- cgit 1.2.3-korg