diff options
author | WuKong <rebirthmonkey@gmail.com> | 2017-12-23 21:49:35 +0100 |
---|---|---|
committer | WuKong <rebirthmonkey@gmail.com> | 2017-12-23 21:49:58 +0100 |
commit | 1100c66ce03a059ebe7ece9734e799b49b3a5a9e (patch) | |
tree | a057e7e7511f6675a9327b79e6919f07c5f89f07 /moonv4/tests/scenario/rbac_custom_1000.py | |
parent | 7a4dfdde6314476ae2a1a1c881ff1e3c430f790e (diff) |
moonv4 cleanup
Change-Id: Icef927f3236d985ac13ff7376f6ce6314b2b39b0
Signed-off-by: WuKong <rebirthmonkey@gmail.com>
Diffstat (limited to 'moonv4/tests/scenario/rbac_custom_1000.py')
-rw-r--r-- | moonv4/tests/scenario/rbac_custom_1000.py | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/moonv4/tests/scenario/rbac_custom_1000.py b/moonv4/tests/scenario/rbac_custom_1000.py deleted file mode 100644 index d6850485..00000000 --- a/moonv4/tests/scenario/rbac_custom_1000.py +++ /dev/null @@ -1,89 +0,0 @@ -import random - -pdp_name = "pdp_1000" -policy_name = "RBAC policy example 1000 users" -model_name = "RBAC" -policy_genre = "authz" - -SUBJECT_NUMBER = 1000 -OBJECT_NUMBER = 500 -ROLE_NUMBER = 50 - -subjects = {} -for _id in range(SUBJECT_NUMBER): - subjects["user{}".format(_id)] = "" -objects = {} -for _id in range(OBJECT_NUMBER): - objects["vm{}".format(_id)] = "" -actions = { - "start": "", - "stop": "", - "pause": "", - "unpause": "", - "destroy": "", -} - -subject_categories = {"role": "", } -object_categories = {"id": "", } -action_categories = {"action-type": "", } - -subject_data = {"role": {"admin": "", "*": ""}} -for _id in range(ROLE_NUMBER): - subject_data["role"]["role{}".format(_id)] = "" -object_data = {"id": {"*": ""}} -for _id in range(OBJECT_NUMBER): - object_data["id"]["vm{}".format(_id)] = "" -action_data = {"action-type": { - "vm-read": "", - "vm-write": "", - "*": "" -}} - -subject_assignments = {} -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - subject_assignments["user{}".format(_id)] = [{"role": _role}, {"role": "*"}] -object_assignments = {"vm0": ({"id": "vm0"}, {"id": "*"}), "vm1": ({"id": "vm1"}, {"id": "*"})} -for _id in range(OBJECT_NUMBER): - object_assignments["vm{}".format(_id)] = [{"id": "vm{}".format(_id)}, {"id": "*"}] -action_assignments = { - "start": ({"action-type": "vm-write"}, {"action-type": "*"}), - "stop": ({"action-type": "vm-write"}, {"action-type": "*"}), - "pause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "unpause": ({"action-type": "vm-read"}, {"action-type": "*"}), - "destroy": ({"action-type": "vm-write"}, {"action-type": "*"}), -} - -meta_rule = { - "rbac": {"id": "", "value": ("role", "id", "action-type")}, -} - -rules = { - "rbac": [ - { - "rule": ("admin", "vm0", "vm-read"), - "instructions": ( - {"decision": "grant"}, - ) - }, - { - "rule": ("admin", "vm0", "vm-write"), - "instructions": ( - {"decision": "grant"}, - ) - }, - ] -} - -for _id in range(SUBJECT_NUMBER): - _role = "role{}".format(random.randrange(ROLE_NUMBER)) - _vm = "vm{}".format(random.randrange(OBJECT_NUMBER)) - _action = random.choice(list(action_data['action-type'].keys())) - rules["rbac"].append( - { - "rule": (_role, _vm, _action), - "instructions": ( - {"decision": "grant"}, - ) - }, - ) |