From 1adcb43e88edb40627e4b07dc4b525d586c9289e Mon Sep 17 00:00:00 2001 From: Endi S. Dewata Date: Fri, 19 Nov 2010 16:58:55 -0600 Subject: [PATCH] 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/Makefile.am | 4 + install/static/hbac.js | 4 +- install/static/hbacsvc.js | 35 ++++++---- install/static/hbacsvcgroup.js | 39 +++++++---- install/static/index.html | 2 + install/static/navigation.js | 3 +- install/static/{hbacsvc.js => sudocmd.js} | 71 ++++++++++-------- .../static/{hbacsvcgroup.js => sudocmdgroup.js} | 77 +++++++++++--------- install/static/sudorule.js | 37 ++++++++++ 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 +++++++++++ 21 files changed, 488 insertions(+), 96 deletions(-) copy install/static/{hbacsvc.js => sudocmd.js} (65%) copy install/static/{hbacsvcgroup.js => sudocmdgroup.js} (68%) 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 diff --git a/install/static/Makefile.am b/install/static/Makefile.am index 0e3effeef63ef4e0b1c8def6e3369480988880d6..8e4981984e656b55b75f765754f6aca487664865 100644 --- a/install/static/Makefile.am +++ b/install/static/Makefile.am @@ -20,6 +20,8 @@ app_DATA = \ certificate.js \ group.js \ hbac.js \ + hbacsvc.js \ + hbacsvcgroup.js \ host.js \ hostgroup.js \ index.html \ @@ -29,6 +31,8 @@ app_DATA = \ service.js \ serverconfig.js \ sudorule.js \ + sudocmd.js \ + sudocmdgroup.js \ policy.js \ search.js \ rule.js \ diff --git a/install/static/hbac.js b/install/static/hbac.js index 12883efa31122cd48398cae94688e41359ebd2e6..a6162b8bf7cf692b2586632191fcc9b2e8f5334b 100755 --- a/install/static/hbac.js +++ b/install/static/hbac.js @@ -152,7 +152,7 @@ function ipa_hbac_search_facet(spec) { var li = $('li[title=hbacsvc]', action_panel); li.click(function() { var state = {}; - state['entity'] = 'hbacsvc'; + state['hbac-entity'] = 'hbacsvc'; nav_push_state(state); return false; }); @@ -160,7 +160,7 @@ function ipa_hbac_search_facet(spec) { li = $('li[title=hbacsvcgroup]', action_panel); li.click(function() { var state = {}; - state['entity'] = 'hbacsvcgroup'; + state['hbac-entity'] = 'hbacsvcgroup'; nav_push_state(state); return false; }); diff --git a/install/static/hbacsvc.js b/install/static/hbacsvc.js index 13135da243080dfae38b1a472215ed7ede62e1c1..26a2e8a0a3be71ff23edb0c5c0dd5a6e31b77d29 100755 --- a/install/static/hbacsvc.js +++ b/install/static/hbacsvc.js @@ -100,24 +100,12 @@ function ipa_hbacsvc_search_facet(spec) { $('
  • ', { title: 'hbac', - text: 'HBAC Rules', - 'click': function() { - var state = {}; - state['entity'] = 'hbac'; - nav_push_state(state); - return false; - } + text: 'HBAC Rules' }).appendTo(ul); $('
  • ', { title: 'hbacsvcgroup', - text: 'HBAC Service Groups', - 'click': function() { - var state = {}; - state['entity'] = 'hbacsvcgroup'; - nav_push_state(state); - return false; - } + text: 'HBAC Service Groups' }).appendTo(ul); that.search_facet_create(container); @@ -126,10 +114,29 @@ function ipa_hbacsvc_search_facet(spec) { container.children().last().prepend( $('

    ', { 'html': 'HBAC Services' })); container.children().last().prepend('

    '); + }; + that.setup = function(container) { + that.search_facet_setup(container); + var action_panel = that.get_action_panel(); + var li = $('li[title=hbac]', action_panel); + li.click(function() { + var state = {}; + state['hbac-entity'] = 'hbac'; + nav_push_state(state); + return false; + }); + + li = $('li[title=hbacsvcgroup]', action_panel); + li.click(function() { + var state = {}; + state['hbac-entity'] = 'hbacsvcgroup'; + nav_push_state(state); + return false; + }); }; return that; diff --git a/install/static/hbacsvcgroup.js b/install/static/hbacsvcgroup.js index 520f86004de0b65c10fed3865dba33fa0f331baa..056c8fab1ef0d2503db45e4ca083321815847de7 100755 --- a/install/static/hbacsvcgroup.js +++ b/install/static/hbacsvcgroup.js @@ -111,24 +111,12 @@ function ipa_hbacsvcgroup_search_facet(spec) { $('
  • ', { title: 'hbac', - text: 'HBAC Rules', - 'click': function() { - var state = {}; - state['entity'] = 'hbac'; - nav_push_state(state); - return false; - } + text: 'HBAC Rules' }).appendTo(ul); $('
  • ', { title: 'hbacsvc', - text: 'HBAC Services', - 'click': function() { - var state = {}; - state['entity'] = 'hbacsvc'; - nav_push_state(state); - return false; - } + text: 'HBAC Services' }).appendTo(ul); that.search_facet_create(container); @@ -140,6 +128,29 @@ function ipa_hbacsvcgroup_search_facet(spec) { }; + that.setup = function(container) { + + that.search_facet_setup(container); + + var action_panel = that.get_action_panel(); + + var li = $('li[title=hbac]', action_panel); + li.click(function() { + var state = {}; + state['hbac-entity'] = 'hbac'; + nav_push_state(state); + return false; + }); + + li = $('li[title=hbacsvc]', action_panel); + li.click(function() { + var state = {}; + state['hbac-entity'] = 'hbacsvc'; + nav_push_state(state); + return false; + }); + }; + return that; } diff --git a/install/static/index.html b/install/static/index.html index 643c076ca59012908cf9dc590651889056180a07..a27201033d17eb296f6aa7f63a71f43657a7810b 100644 --- a/install/static/index.html +++ b/install/static/index.html @@ -32,6 +32,8 @@ + + diff --git a/install/static/navigation.js b/install/static/navigation.js index 6b4419c9912d90994306e412a4a413604e58852b..e437e569b991cfb1667a6060a29fe4822327c390 100644 --- a/install/static/navigation.js +++ b/install/static/navigation.js @@ -137,7 +137,8 @@ function _nav_update_tabs(nls, container) var entity_name = tab.name; // TODO: do not hard-code - if (entity_name == 'hbac' && nav_get_state('entity')) entity_name = nav_get_state('entity'); + if (entity_name == 'hbac' && nav_get_state('hbac-entity')) entity_name = nav_get_state('hbac-entity'); + if (entity_name == 'sudorule' && nav_get_state('sudo-entity')) entity_name = nav_get_state('sudo-entity'); var entity = IPA.get_entity(entity_name); entity.setup(container2); diff --git a/install/static/hbacsvc.js b/install/static/sudocmd.js similarity index 65% copy from install/static/hbacsvc.js copy to install/static/sudocmd.js index 13135da243080dfae38b1a472215ed7ede62e1c1..2ac947fcfc2b46821f16bc4d0ca7c27996a6f9e0 100755 --- a/install/static/hbacsvc.js +++ b/install/static/sudocmd.js @@ -20,28 +20,28 @@ /* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */ -function ipa_hbacsvc() { +function ipa_sudocmd() { var that = ipa_entity({ - 'name': 'hbacsvc' + 'name': 'sudocmd' }); that.init = function() { - var dialog = ipa_hbacsvc_add_dialog({ + var dialog = ipa_sudocmd_add_dialog({ 'name': 'add', - 'title': 'Add New HBAC Service' + 'title': 'Add New SUDO Command' }); that.add_dialog(dialog); dialog.init(); - var facet = ipa_hbacsvc_search_facet({ + var facet = ipa_sudocmd_search_facet({ 'name': 'search', 'label': 'Search' }); that.add_facet(facet); - facet = ipa_hbacsvc_details_facet({ + facet = ipa_sudocmd_details_facet({ 'name': 'details', 'label': 'Details' }); @@ -53,9 +53,9 @@ function ipa_hbacsvc() { return that; } -IPA.add_entity(ipa_hbacsvc()); +IPA.add_entity(ipa_sudocmd()); -function ipa_hbacsvc_add_dialog(spec) { +function ipa_sudocmd_add_dialog(spec) { spec = spec || {}; @@ -67,26 +67,26 @@ function ipa_hbacsvc_add_dialog(spec) { this.superior_init(); - this.add_field(ipa_text_widget({name:'cn', label:'Name', undo: false})); + this.add_field(ipa_text_widget({name:'sudocmd', label:'Command', undo: false})); this.add_field(ipa_text_widget({name:'description', label:'Description', undo: false})); }; return that; } -function ipa_hbacsvc_search_facet(spec) { +function ipa_sudocmd_search_facet(spec) { spec = spec || {}; var that = ipa_search_facet(spec); that.get_action_panel = function() { - return $('#hbac .action-panel'); + return $('#sudorule .action-panel'); }; that.init = function() { - that.create_column({name:'cn', label:'Service', primary_key: true}); + that.create_column({name:'sudocmd', label:'Command', primary_key: true}); that.create_column({name:'description', label:'Description'}); that.search_facet_init(); @@ -99,44 +99,51 @@ function ipa_hbacsvc_search_facet(spec) { var ul = $('ul', action_panel); $('
  • ', { - title: 'hbac', - text: 'HBAC Rules', - 'click': function() { - var state = {}; - state['entity'] = 'hbac'; - nav_push_state(state); - return false; - } + title: 'sudorule', + text: 'SUDO Rules' }).appendTo(ul); $('
  • ', { - title: 'hbacsvcgroup', - text: 'HBAC Service Groups', - 'click': function() { - var state = {}; - state['entity'] = 'hbacsvcgroup'; - nav_push_state(state); - return false; - } + title: 'sudocmdgroup', + text: 'SUDO Command Groups' }).appendTo(ul); that.search_facet_create(container); // TODO: replace with IPA.metadata[that.entity_name].label container.children().last().prepend( - $('

    ', { 'html': 'HBAC Services' })); + $('

    ', { 'html': 'SUDO Commands' })); container.children().last().prepend('

    '); + }; + that.setup = function(container) { + that.search_facet_setup(container); + var action_panel = that.get_action_panel(); + var li = $('li[title=sudorule]', action_panel); + li.click(function() { + var state = {}; + state['sudo-entity'] = 'sudorule'; + nav_push_state(state); + return false; + }); + + li = $('li[title=sudocmdgroup]', action_panel); + li.click(function() { + var state = {}; + state['sudo-entity'] = 'sudocmdgroup'; + nav_push_state(state); + return false; + }); }; return that; } -function ipa_hbacsvc_details_facet(spec) { +function ipa_sudocmd_details_facet(spec) { spec = spec || {}; @@ -147,7 +154,7 @@ function ipa_hbacsvc_details_facet(spec) { that.superior_setup = that.superior('setup'); that.get_action_panel = function() { - return $('#hbac .action-panel'); + return $('#sudorule .action-panel'); }; that.init = function() { @@ -158,7 +165,7 @@ function ipa_hbacsvc_details_facet(spec) { }); that.add_section(section); - section.create_field({ 'name': 'cn', 'label': 'Name' }); + section.create_field({ 'name': 'sudocmd', 'label': 'Command' }); section.create_field({ 'name': 'description', 'label': 'Description' }); that.superior_init(); diff --git a/install/static/hbacsvcgroup.js b/install/static/sudocmdgroup.js similarity index 68% copy from install/static/hbacsvcgroup.js copy to install/static/sudocmdgroup.js index 520f86004de0b65c10fed3865dba33fa0f331baa..0a193afabd41ea0ad8cc925ec31fe9486c4afc25 100755 --- a/install/static/hbacsvcgroup.js +++ b/install/static/sudocmdgroup.js @@ -20,40 +20,40 @@ /* REQUIRES: ipa.js, details.js, search.js, add.js, entity.js */ -function ipa_hbacsvcgroup() { +function ipa_sudocmdgroup() { var that = ipa_entity({ - 'name': 'hbacsvcgroup' + 'name': 'sudocmdgroup' }); that.init = function() { that.create_association({ - 'name': 'hbacsvc', + 'name': 'sudocmd', 'add_method': 'add_member', 'delete_method': 'remove_member' }); - var dialog = ipa_hbacsvcgroup_add_dialog({ + var dialog = ipa_sudocmdgroup_add_dialog({ 'name': 'add', - 'title': 'Add New HBAC Service Group' + 'title': 'Add New SUDO Command Group' }); that.add_dialog(dialog); dialog.init(); - var facet = ipa_hbacsvcgroup_search_facet({ + var facet = ipa_sudocmdgroup_search_facet({ 'name': 'search', 'label': 'Search' }); that.add_facet(facet); - facet = ipa_hbacsvcgroup_details_facet({ + facet = ipa_sudocmdgroup_details_facet({ 'name': 'details', 'label': 'Details' }); that.add_facet(facet); - facet = ipa_hbacsvcgroup_association_facet({ + facet = ipa_sudocmdgroup_association_facet({ 'name': 'associate' }); that.add_facet(facet); @@ -64,9 +64,9 @@ function ipa_hbacsvcgroup() { return that; } -IPA.add_entity(ipa_hbacsvcgroup()); +IPA.add_entity(ipa_sudocmdgroup()); -function ipa_hbacsvcgroup_add_dialog(spec) { +function ipa_sudocmdgroup_add_dialog(spec) { spec = spec || {}; @@ -85,14 +85,14 @@ function ipa_hbacsvcgroup_add_dialog(spec) { return that; } -function ipa_hbacsvcgroup_search_facet(spec) { +function ipa_sudocmdgroup_search_facet(spec) { spec = spec || {}; var that = ipa_search_facet(spec); that.get_action_panel = function() { - return $('#hbac .action-panel'); + return $('#sudorule .action-panel'); }; that.init = function() { @@ -110,48 +110,59 @@ function ipa_hbacsvcgroup_search_facet(spec) { var ul = $('ul', action_panel); $('
  • ', { - title: 'hbac', - text: 'HBAC Rules', - 'click': function() { - var state = {}; - state['entity'] = 'hbac'; - nav_push_state(state); - return false; - } + title: 'sudorule', + text: 'SUDO Rules' }).appendTo(ul); $('
  • ', { - title: 'hbacsvc', - text: 'HBAC Services', - 'click': function() { - var state = {}; - state['entity'] = 'hbacsvc'; - nav_push_state(state); - return false; - } + title: 'sudocmd', + text: 'SUDO Command' }).appendTo(ul); that.search_facet_create(container); // TODO: replace with IPA.metadata[that.entity_name].label container.children().last().prepend( - $('

    ', { 'html': 'HBAC Service Groups' })); + $('

    ', { 'html': 'SUDO Command Groups' })); container.children().last().prepend('

    '); }; + that.setup = function(container) { + + that.search_facet_setup(container); + + var action_panel = that.get_action_panel(); + + var li = $('li[title=sudorule]', action_panel); + li.click(function() { + var state = {}; + state['sudo-entity'] = 'sudorule'; + nav_push_state(state); + return false; + }); + + li = $('li[title=sudocmd]', action_panel); + li.click(function() { + var state = {}; + state['sudo-entity'] = 'sudocmd'; + nav_push_state(state); + return false; + }); + }; + return that; } -function ipa_hbacsvcgroup_details_facet(spec) { +function ipa_sudocmdgroup_details_facet(spec) { spec = spec || {}; var that = ipa_details_facet(spec); that.get_action_panel = function() { - return $('#hbac .action-panel'); + return $('#sudorule .action-panel'); }; that.init = function() { @@ -171,14 +182,14 @@ function ipa_hbacsvcgroup_details_facet(spec) { return that; } -function ipa_hbacsvcgroup_association_facet(spec) { +function ipa_sudocmdgroup_association_facet(spec) { spec = spec || {}; var that = ipa_association_facet(spec); that.get_action_panel = function() { - return $('#hbac .action-panel'); + return $('#sudorule .action-panel'); }; return that; diff --git a/install/static/sudorule.js b/install/static/sudorule.js index 60cf4d3e965bf54e1d19fcf12a57177ac3cbd0d8..f936ebcde8198575e48d06257d44f0ae23ace366 100755 --- a/install/static/sudorule.js +++ b/install/static/sudorule.js @@ -92,6 +92,20 @@ function ipa_sudorule_search_facet(spec) { that.create = function(container) { + var action_panel = that.get_action_panel(); + + var ul = $('ul', action_panel); + + $('
  • ', { + title: 'sudocmd', + text: 'SUDO Commands' + }).appendTo(ul); + + $('
  • ', { + title: 'sudocmdgroup', + text: 'SUDO Command Groups' + }).appendTo(ul); + that.search_facet_create(container); // TODO: replace with IPA.metadata[that.entity_name].label @@ -101,6 +115,29 @@ function ipa_sudorule_search_facet(spec) { }; + that.setup = function(container) { + + that.search_facet_setup(container); + + var action_panel = that.get_action_panel(); + + var li = $('li[title=sudocmd]', action_panel); + li.click(function() { + var state = {}; + state['sudo-entity'] = 'sudocmd'; + nav_push_state(state); + return false; + }); + + li = $('li[title=sudocmdgroup]', action_panel); + li.click(function() { + var state = {}; + state['sudo-entity'] = 'sudocmdgroup'; + nav_push_state(state); + return false; + }); + }; + return that; } diff --git a/install/static/test/data/sudocmd_add.json b/install/static/test/data/sudocmd_add.json new file mode 100644 index 0000000000000000000000000000000000000000..6de1def494a487a7e84c1f817171c31a247cac62 --- /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 0000000000000000000000000000000000000000..d6bc5ad00e17993c21ace762953accc296b93bf7 --- /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 0000000000000000000000000000000000000000..6398771564b5ccc069a188703dd3140c81dcbe4d --- /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 0000000000000000000000000000000000000000..82919cd2d25198be4ac75d63f9ee3ee49cdd3030 --- /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 0000000000000000000000000000000000000000..f9eacc39b07ed0ad53a361948caf6329c4abb4df --- /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 0000000000000000000000000000000000000000..951a3a9170a55ab9bae2b658549663f6f693d0fc --- /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 0000000000000000000000000000000000000000..0646f7251e125fbc2396d6483f1a0321911b3bda --- /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 0000000000000000000000000000000000000000..24c7ab692522a1666906d56d1bf32d225398a9a5 --- /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 0000000000000000000000000000000000000000..fb2effd2301e152e632cf3062a38690210158e37 --- /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 0000000000000000000000000000000000000000..d0eb3226b3804ac911b7f0847417918b9feca954 --- /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 0000000000000000000000000000000000000000..55144b9c6b8c137505685f6a34453174a015db5d --- /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 0000000000000000000000000000000000000000..f93ddaa673d30a9cf7ebc2e0a601cf23d92ae120 --- /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 -- 1.6.6.1