From 839c1468cbe2025e759458bbe82c2f99a5ea347f Mon Sep 17 00:00:00 2001 From: SerenaFeng Date: Fri, 20 Oct 2017 16:13:29 +0800 Subject: allow authentication to be disabled in local deployment situation, authentication can be disabled by setting authenticate=False of ui section in config.ini JIRA: RELENG-324 Change-Id: I9157d1723851feb12435033dbdd59035e3eb5777 Signed-off-by: SerenaFeng --- testapi/opnfv_testapi/common/check.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'testapi/opnfv_testapi/common/check.py') diff --git a/testapi/opnfv_testapi/common/check.py b/testapi/opnfv_testapi/common/check.py index e80b1c6..fd30c9b 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()) -- cgit 1.2.3-korg