diff options
author | asteroide <thomas.duval@orange.com> | 2017-05-15 14:19:43 +0200 |
---|---|---|
committer | asteroide <thomas.duval@orange.com> | 2017-05-15 14:19:43 +0200 |
commit | 019b10d95976bb80bcce60ee93099b0fd57fcab5 (patch) | |
tree | 9e2b5c68dd8dadfc97346b77bf5549edbdf2c57a /moonv4/moon_interface/tests/apitests/scenario/rbac.py | |
parent | 80ca346a4cb183a6a1e684f6d8a9e19e3fc55d0e (diff) |
Update Moon engine to allow a session policy
Change-Id: I63a80597710f08a6641e159cc2306d3cc68b1240
Diffstat (limited to 'moonv4/moon_interface/tests/apitests/scenario/rbac.py')
-rw-r--r-- | moonv4/moon_interface/tests/apitests/scenario/rbac.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/moonv4/moon_interface/tests/apitests/scenario/rbac.py b/moonv4/moon_interface/tests/apitests/scenario/rbac.py index a43bd1f4..89fd7de8 100644 --- a/moonv4/moon_interface/tests/apitests/scenario/rbac.py +++ b/moonv4/moon_interface/tests/apitests/scenario/rbac.py @@ -2,6 +2,7 @@ pdp_name = "pdp1" policy_name = "RBAC policy example" model_name = "RBAC" +policy_genre = "authz" subjects = {"user0": "", "user1": "", } objects = {"vm0": "", "vm1": "", } @@ -11,13 +12,13 @@ subject_categories = {"role": "", } object_categories = {"id": "", } action_categories = {"action-type": "", } -subject_data = {"role": {"admin": "", "employee": ""}} -object_data = {"id": {"vm0": "", "vm1": ""}} -action_data = {"action-type": {"vm-action": "", }} +subject_data = {"role": {"admin": "", "employee": "", "*": ""}} +object_data = {"id": {"vm0": "", "vm1": "", "*": ""}} +action_data = {"action-type": {"vm-action": "", "*": ""}} -subject_assignments = {"user0": {"role": "employee"}, "user1": {"role": "employee"}, } -object_assignments = {"vm0": {"id": "vm0"}, "vm1": {"id": "vm1"}} -action_assignments = {"start": {"action-type": "vm-action"}, "stop": {"action-type": "vm-action"}} +subject_assignments = {"user0": ({"role": "employee"}, {"role": "*"}), "user1": ({"role": "employee"}, {"role": "*"}), } +object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} +action_assignments = {"start": ({"action-type": "vm-action"}, {"action-type": "*"}), "stop": ({"action-type": "vm-action"}, {"action-type": "*"})} meta_rule = { "rbac": {"id": "", "value": ("role", "id", "action-type")}, @@ -28,13 +29,13 @@ rules = { { "rule": ("admin", "vm0", "vm-action"), "instructions": ( - {"decision": "grant"} # "grant" to immediately exit, "continue" to wait for the result of next policy + {"decision": "grant"}, # "grant" to immediately exit, "continue" to wait for the result of next policy ) }, { - "rule": ("admin", "vm1", "vm-action"), + "rule": ("employee", "vm1", "vm-action"), "instructions": ( - {"decision": "grant"} + {"decision": "grant"}, ) }, ) |