aboutsummaryrefslogtreecommitdiffstats
path: root/moonv4/moon_utilities/tests/unit_python/data_mock.py
diff options
context:
space:
mode:
Diffstat (limited to 'moonv4/moon_utilities/tests/unit_python/data_mock.py')
-rw-r--r--moonv4/moon_utilities/tests/unit_python/data_mock.py36
1 files changed, 29 insertions, 7 deletions
diff --git a/moonv4/moon_utilities/tests/unit_python/data_mock.py b/moonv4/moon_utilities/tests/unit_python/data_mock.py
index 0a70eb86..0da5f024 100644
--- a/moonv4/moon_utilities/tests/unit_python/data_mock.py
+++ b/moonv4/moon_utilities/tests/unit_python/data_mock.py
@@ -1,4 +1,3 @@
-""" data mock models"""
COMPONENTS = {
"manager": {
"port": 8082,
@@ -15,7 +14,7 @@ pdp_mock = {
},
"pdp_id12": {
"name": "...",
- "security_pipeline": [],
+ "security_pipeline": ["policy_id_1", "policy_id_2"],
"keystone_project_id": "keystone_project_id1",
"description": "...",
}
@@ -141,11 +140,34 @@ models_mock = {
rules_mock = {
"rules": {
- "policy_id": "policy_id1",
"meta_rule_id": "meta_rule_id1",
- "rule_id1":
- ["subject_data_id1", "object_data_id1", "action_data_id1"],
- "rule_id2":
- ["subject_data_id2", "object_data_id2", "action_data_id2"],
+ "rule_id1": {
+ "rule": ["subject_data_id1",
+ "object_data_id1",
+ "action_data_id1"],
+ "instructions": (
+ {"decision": "grant"},
+ # "grant" to immediately exit,
+ # "continue" to wait for the result of next policy
+ # "deny" to deny the request
+ )
+ },
+ "rule_id2": {
+ "rule": ["subject_data_id2",
+ "object_data_id2",
+ "action_data_id2"],
+ "instructions": (
+ {
+ "update": {
+ "operation": "add",
+ # operations may be "add" or "delete"
+ "target": "rbac:role:admin"
+ # add the role admin to the current user
+ }
+ },
+ {"chain": {"name": "rbac"}}
+ # chain with the policy named rbac
+ )
+ }
}
}