From b9f539ba19b40361265c7897a73a1f5757ed0e68 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Fri, 19 Nov 2010 16:58:55 -0600 Subject: SUDO Commands and Command Groups The SUDO Commands and Command Groups pages have been added under SUDO Rules tab. Similar to HBAC navigation issue, these entities do not have their own tab, so an exception has been added to the navigation code to read sudo-entity parameter to determine the entity being viewed. Fixing this issue will require framework changes. New test data for these operations have been added. --- install/static/test/data/sudocmd_add.json | 21 +++++++++++ install/static/test/data/sudocmd_del.json | 9 +++++ install/static/test/data/sudocmd_find.json | 23 +++++++++++ install/static/test/data/sudocmd_mod.json | 31 +++++++++++++++ install/static/test/data/sudocmd_show.json | 29 ++++++++++++++ install/static/test/data/sudocmdgroup_add.json | 26 +++++++++++++ .../static/test/data/sudocmdgroup_add_member.json | 26 +++++++++++++ install/static/test/data/sudocmdgroup_del.json | 9 +++++ install/static/test/data/sudocmdgroup_find.json | 33 ++++++++++++++++ install/static/test/data/sudocmdgroup_mod.json | 39 +++++++++++++++++++ .../test/data/sudocmdgroup_remove_member.json | 22 +++++++++++ install/static/test/data/sudocmdgroup_show.json | 44 ++++++++++++++++++++++ 12 files changed, 312 insertions(+) create mode 100644 install/static/test/data/sudocmd_add.json create mode 100644 install/static/test/data/sudocmd_del.json create mode 100644 install/static/test/data/sudocmd_find.json create mode 100644 install/static/test/data/sudocmd_mod.json create mode 100644 install/static/test/data/sudocmd_show.json create mode 100644 install/static/test/data/sudocmdgroup_add.json create mode 100644 install/static/test/data/sudocmdgroup_add_member.json create mode 100644 install/static/test/data/sudocmdgroup_del.json create mode 100644 install/static/test/data/sudocmdgroup_find.json create mode 100644 install/static/test/data/sudocmdgroup_mod.json create mode 100644 install/static/test/data/sudocmdgroup_remove_member.json create mode 100644 install/static/test/data/sudocmdgroup_show.json (limited to 'install/static/test') diff --git a/install/static/test/data/sudocmd_add.json b/install/static/test/data/sudocmd_add.json new file mode 100644 index 000000000..6de1def49 --- /dev/null +++ b/install/static/test/data/sudocmd_add.json @@ -0,0 +1,21 @@ +{ + "error": null, + "id": 0, + "result": { + "result": { + "dn": "sudocmd=/usr/bin/less,cn=sudocmds,cn=accounts,dc=dev,dc=example,dc=com", + "ipauniqueid": [ + "09e4ab26-f456-11df-bb95-00163e72f2d9" + ], + "objectclass": [ + "ipaobject", + "ipasudocmd" + ], + "sudocmd": [ + "/usr/bin/less" + ] + }, + "summary": "Added sudo command \"/usr/bin/less\"", + "value": "/usr/bin/less" + } +} diff --git a/install/static/test/data/sudocmd_del.json b/install/static/test/data/sudocmd_del.json new file mode 100644 index 000000000..d6bc5ad00 --- /dev/null +++ b/install/static/test/data/sudocmd_del.json @@ -0,0 +1,9 @@ +{ + "error": null, + "id": 0, + "result": { + "result": true, + "summary": "Deleted sudo command \"/usr/bin/less\"", + "value": "/usr/bin/less" + } +} diff --git a/install/static/test/data/sudocmd_find.json b/install/static/test/data/sudocmd_find.json new file mode 100644 index 000000000..639877156 --- /dev/null +++ b/install/static/test/data/sudocmd_find.json @@ -0,0 +1,23 @@ +{ + "error": null, + "id": 0, + "result": { + "count": 2, + "result": [ + { + "dn": "sudocmd=/usr/bin/more,cn=sudocmds,cn=accounts,dc=dev,dc=example,dc=com", + "sudocmd": [ + "/usr/bin/more" + ] + }, + { + "dn": "sudocmd=/usr/bin/less,cn=sudocmds,cn=accounts,dc=dev,dc=example,dc=com", + "sudocmd": [ + "/usr/bin/less" + ] + } + ], + "summary": "2 sudo command matched", + "truncated": false + } +} diff --git a/install/static/test/data/sudocmd_mod.json b/install/static/test/data/sudocmd_mod.json new file mode 100644 index 000000000..82919cd2d --- /dev/null +++ b/install/static/test/data/sudocmd_mod.json @@ -0,0 +1,31 @@ +{ + "error": null, + "id": 0, + "result": { + "result": { + "attributelevelrights": { + "aci": "rscwo", + "description": "rscwo", + "ipauniqueid": "rsc", + "memberof": "rsc", + "nsaccountlock": "rscwo", + "sudocmd": "rscwo" + }, + "description": [ + "opposite of more" + ], + "ipauniqueid": [ + "06708d0e-f454-11df-9273-00163e72f2d9" + ], + "objectclass": [ + "ipaobject", + "ipasudocmd" + ], + "sudocmd": [ + "/usr/bin/less" + ] + }, + "summary": "Modified sudo command \"/usr/bin/less\"", + "value": "/usr/bin/less" + } +} diff --git a/install/static/test/data/sudocmd_show.json b/install/static/test/data/sudocmd_show.json new file mode 100644 index 000000000..f9eacc39b --- /dev/null +++ b/install/static/test/data/sudocmd_show.json @@ -0,0 +1,29 @@ +{ + "error": null, + "id": 0, + "result": { + "result": { + "attributelevelrights": { + "aci": "rscwo", + "description": "rscwo", + "ipauniqueid": "rsc", + "memberof": "rsc", + "nsaccountlock": "rscwo", + "sudocmd": "rscwo" + }, + "dn": "sudocmd=/usr/bin/less,cn=sudocmds,cn=accounts,dc=dev,dc=example,dc=com", + "ipauniqueid": [ + "06708d0e-f454-11df-9273-00163e72f2d9" + ], + "objectclass": [ + "ipaobject", + "ipasudocmd" + ], + "sudocmd": [ + "/usr/bin/less" + ] + }, + "summary": null, + "value": "/usr/bin/less" + } +} diff --git a/install/static/test/data/sudocmdgroup_add.json b/install/static/test/data/sudocmdgroup_add.json new file mode 100644 index 000000000..951a3a917 --- /dev/null +++ b/install/static/test/data/sudocmdgroup_add.json @@ -0,0 +1,26 @@ +{ + "error": null, + "id": 0, + "result": { + "result": { + "cn": [ + "group1" + ], + "description": [ + "Group 1" + ], + "dn": "cn=group1,cn=sudocmdgroups,cn=accounts,dc=dev,dc=example,dc=com", + "ipauniqueid": [ + "1a8f4852-f459-11df-815c-00163e72f2d9" + ], + "objectclass": [ + "ipaobject", + "ipasudocmdgrp", + "groupOfNames", + "top" + ] + }, + "summary": "Added sudo command group \"group1\"", + "value": "group1" + } +} diff --git a/install/static/test/data/sudocmdgroup_add_member.json b/install/static/test/data/sudocmdgroup_add_member.json new file mode 100644 index 000000000..0646f7251 --- /dev/null +++ b/install/static/test/data/sudocmdgroup_add_member.json @@ -0,0 +1,26 @@ +{ + "error": null, + "id": 0, + "result": { + "completed": 2, + "failed": { + "member": { + "sudocmd": [], + "sudocmdgroup": [] + } + }, + "result": { + "cn": [ + "group1" + ], + "description": [ + "SUDO Group 1" + ], + "dn": "cn=group1,cn=sudocmdgroups,cn=accounts,dc=dev,dc=example,dc=com", + "member_sudocmd": [ + "/usr/bin/more", + "/usr/bin/less" + ] + } + } +} diff --git a/install/static/test/data/sudocmdgroup_del.json b/install/static/test/data/sudocmdgroup_del.json new file mode 100644 index 000000000..24c7ab692 --- /dev/null +++ b/install/static/test/data/sudocmdgroup_del.json @@ -0,0 +1,9 @@ +{ + "error": null, + "id": 0, + "result": { + "result": true, + "summary": "Deleted sudo command group \"group1\"", + "value": "group1" + } +} diff --git a/install/static/test/data/sudocmdgroup_find.json b/install/static/test/data/sudocmdgroup_find.json new file mode 100644 index 000000000..fb2effd23 --- /dev/null +++ b/install/static/test/data/sudocmdgroup_find.json @@ -0,0 +1,33 @@ +{ + "error": null, + "id": 0, + "result": { + "count": 2, + "result": [ + { + "cn": [ + "group1" + ], + "description": [ + "Group 1" + ], + "dn": "cn=group1,cn=sudocmdgroups,cn=accounts,dc=dev,dc=example,dc=com", + "member_sudocmd": [ + "/usr/bin/more", + "/usr/bin/less" + ] + }, + { + "cn": [ + "group2" + ], + "description": [ + "Group 2" + ], + "dn": "cn=group2,cn=sudocmdgroups,cn=accounts,dc=dev,dc=example,dc=com" + } + ], + "summary": "2 sudo command groups matched", + "truncated": false + } +} diff --git a/install/static/test/data/sudocmdgroup_mod.json b/install/static/test/data/sudocmdgroup_mod.json new file mode 100644 index 000000000..d0eb3226b --- /dev/null +++ b/install/static/test/data/sudocmdgroup_mod.json @@ -0,0 +1,39 @@ +{ + "error": null, + "id": 0, + "result": { + "result": { + "attributelevelrights": { + "aci": "rscwo", + "businesscategory": "rscwo", + "cn": "rscwo", + "description": "rscwo", + "ipauniqueid": "rsc", + "member": "rscwo", + "nsaccountlock": "rscwo", + "o": "rscwo", + "objectclass": "rscwo", + "ou": "rscwo", + "owner": "rscwo", + "seealso": "rscwo" + }, + "cn": [ + "group1" + ], + "description": [ + "SUDO Group 1" + ], + "ipauniqueid": [ + "1a8f4852-f459-11df-815c-00163e72f2d9" + ], + "objectclass": [ + "ipaobject", + "ipasudocmdgrp", + "groupOfNames", + "top" + ] + }, + "summary": "Modified sudo command group \"group1\"", + "value": "group1" + } +} diff --git a/install/static/test/data/sudocmdgroup_remove_member.json b/install/static/test/data/sudocmdgroup_remove_member.json new file mode 100644 index 000000000..55144b9c6 --- /dev/null +++ b/install/static/test/data/sudocmdgroup_remove_member.json @@ -0,0 +1,22 @@ +{ + "error": null, + "id": 0, + "result": { + "completed": 2, + "failed": { + "member": { + "sudocmd": [], + "sudocmdgroup": [] + } + }, + "result": { + "cn": [ + "group1" + ], + "description": [ + "SUDO Group 1" + ], + "dn": "cn=group1,cn=sudocmdgroups,cn=accounts,dc=dev,dc=example,dc=com" + } + } +} diff --git a/install/static/test/data/sudocmdgroup_show.json b/install/static/test/data/sudocmdgroup_show.json new file mode 100644 index 000000000..f93ddaa67 --- /dev/null +++ b/install/static/test/data/sudocmdgroup_show.json @@ -0,0 +1,44 @@ +{ + "error": null, + "id": 0, + "result": { + "result": { + "attributelevelrights": { + "aci": "rscwo", + "businesscategory": "rscwo", + "cn": "rscwo", + "description": "rscwo", + "ipauniqueid": "rsc", + "member": "rscwo", + "nsaccountlock": "rscwo", + "o": "rscwo", + "objectclass": "rscwo", + "ou": "rscwo", + "owner": "rscwo", + "seealso": "rscwo" + }, + "cn": [ + "group1" + ], + "description": [ + "Group 1" + ], + "dn": "cn=group1,cn=sudocmdgroups,cn=accounts,dc=dev,dc=example,dc=com", + "ipauniqueid": [ + "d99989a6-f459-11df-9273-00163e72f2d9" + ], + "member_sudocmd": [ + "/usr/bin/more", + "/usr/bin/less" + ], + "objectclass": [ + "ipaobject", + "ipasudocmdgrp", + "groupOfNames", + "top" + ] + }, + "summary": null, + "value": "group1" + } +} \ No newline at end of file -- cgit