summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorvrvarma <vv8305@att.com>2019-04-09 09:31:42 -0400
committervrvarma <vv8305@att.com>2019-04-09 09:31:53 -0400
commit4cfb2d4827156cd4dd64a09ada3214415a8a7fdd (patch)
treecc78a1be4f0c47ab01d299b2cfc7dbdf39572031 /test
parent2d59800cf61a90e2a80902186bdce3b28e5ae14d (diff)
Reduce AAF auth permission cache time to 5 mins
Refactor code smell issues found in sonar Change-Id: I819a91e374609224561afa7ddb6878fab37feaf2 Signed-off-by: vrvarma <vv8305@att.com> Issue-ID: OPTFRA-471
Diffstat (limited to 'test')
-rwxr-xr-xtest/config/osdf_config.yaml2
-rw-r--r--test/test_aaf_authentication.py7
2 files changed, 5 insertions, 4 deletions
diff --git a/test/config/osdf_config.yaml b/test/config/osdf_config.yaml
index 8cff1d5..7582696 100755
--- a/test/config/osdf_config.yaml
+++ b/test/config/osdf_config.yaml
@@ -48,7 +48,7 @@ osdfPlacementUsername: "test"
osdfPlacementPassword: "testpwd"
is_aaf_enabled: False
-aaf_cache_expiry_hrs: 3
+aaf_cache_expiry_mins: 5
aaf_url: https://aaftest.simpledemo.onap.org:8095
aaf_user_roles:
- /api/oof/v1/placement:org.onap.osdf.access|*|read ALL
diff --git a/test/test_aaf_authentication.py b/test/test_aaf_authentication.py
index f20a860..e69b2aa 100644
--- a/test/test_aaf_authentication.py
+++ b/test/test_aaf_authentication.py
@@ -16,6 +16,7 @@
# -------------------------------------------------------------------------
#
import os
+
from flask import Flask
from mock import mock
@@ -33,7 +34,7 @@ class TestAafAuthentication():
def mock_aaf_response(*args, **kwargs):
return {"perm": [{"instance": "menu_ecd", "action": "*", "type": "org.onap.oof.controller.dev.menu"},
- {"instance": "*", "action": "*", "type": "org.onap.osdf.access"},
+ {"instance": "*", "action": "read", "type": "org.onap.osdf.access"},
{"instance": "aaf", "action": "request", "type": "org.onap.osdf.certman"},
{"instance": "*", "action": "*", "type": "org.onap.osdf.dev.access"},
{"instance": ":*:*", "action": "*", "type": "org.onap.osdf.dev.k8"},
@@ -48,8 +49,8 @@ class TestAafAuthentication():
auth.clear_cache()
def mock_aaf_response(*args, **kwargs):
- return {"perm": [{"instance": "menu_ecd", "action": "*", "type": "org.onap.oof.controller.dev.menu"},
- {"instance": "*", "action": "*", "type": "org.onap.osdf.access"},
+ return {"perm": [{"instance": "menu_ecd", "action": "*", "type": "org.onap.osdf.controller.dev.menu"},
+ {"instance": "*", "action": "read", "type": "org.onap.osdf.access"},
{"instance": "aaf", "action": "request", "type": "org.onap.osdf.certman"},
{"instance": "*", "action": "*", "type": "org.onap.osdf.dev.access"},
{"instance": ":*:*", "action": "*", "type": "org.onap.osdf.dev.k8"},