diff options
author | SerenaFeng <feng.xiaowei@zte.com.cn> | 2017-10-20 16:13:29 +0800 |
---|---|---|
committer | SerenaFeng <feng.xiaowei@zte.com.cn> | 2017-10-20 16:33:11 +0800 |
commit | 410025769a5f59469722704cdb1d53bfe1d20ba0 (patch) | |
tree | 75e0f7ea185254aeba0314a53b8b59da033fecc4 /utils/test/testapi/opnfv_testapi/common | |
parent | dfe4f90bdcd765d3045ee1a9c6f00ea0b394e665 (diff) |
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 <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'utils/test/testapi/opnfv_testapi/common')
-rw-r--r-- | utils/test/testapi/opnfv_testapi/common/check.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/test/testapi/opnfv_testapi/common/check.py b/utils/test/testapi/opnfv_testapi/common/check.py index e80b1c6b7..fd30c9b3f 100644 --- a/utils/test/testapi/opnfv_testapi/common/check.py +++ b/utils/test/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()) |