summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/common
diff options
context:
space:
mode:
authorSerena Feng <feng.xiaowei@zte.com.cn>2017-10-23 01:27:12 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-10-23 01:27:12 +0000
commitd62585d81b030d9c94e14ff3f0a6fb3205bbd61b (patch)
tree67510b97e2ac5a170006969e3f29b40a24061e40 /testapi/opnfv_testapi/common
parentf97f2212e862644178b87708ea62eb091b51a506 (diff)
parent839c1468cbe2025e759458bbe82c2f99a5ea347f (diff)
Merge "allow authentication to be disabled"
Diffstat (limited to 'testapi/opnfv_testapi/common')
-rw-r--r--testapi/opnfv_testapi/common/check.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/testapi/opnfv_testapi/common/check.py b/testapi/opnfv_testapi/common/check.py
index 1dff37a..667578f 100644
--- a/testapi/opnfv_testapi/common/check.py
+++ b/testapi/opnfv_testapi/common/check.py
@@ -14,13 +14,14 @@ from tornado import gen
from opnfv_testapi.common import constants
from opnfv_testapi.common import message
from opnfv_testapi.common import raises
+from opnfv_testapi.common.config import CONF
from opnfv_testapi.db import api as dbapi
def is_authorized(method):
@functools.wraps(method)
def wrapper(self, *args, **kwargs):
- if self.table in ['pods']:
+ if CONF.api_authenticate and self.table in ['pods']:
testapi_id = self.get_secure_cookie(constants.TESTAPI_ID)
if not testapi_id:
raises.Unauthorized(message.not_login())