mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Added HBAC Test input validation.
The HBAC Test pages have been modified to validate required input before executing the test. Ticket #388
This commit is contained in:
committed by
Petr Vobornik
parent
b70ebe5c9f
commit
7cb39b8e33
@@ -407,6 +407,25 @@ IPA.hbac.test_select_facet = function(spec) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
that.validate = function(record) {
|
||||||
|
if (record[that.name]) return true;
|
||||||
|
|
||||||
|
var dialog = IPA.message_dialog({
|
||||||
|
title: IPA.messages.dialogs.validation_title,
|
||||||
|
message: IPA.messages.dialogs.validation_message
|
||||||
|
});
|
||||||
|
|
||||||
|
dialog.on_ok = function() {
|
||||||
|
var state = {};
|
||||||
|
state[that.entity.name+'-facet'] = that.name;
|
||||||
|
IPA.nav.push_state(state);
|
||||||
|
};
|
||||||
|
|
||||||
|
dialog.open();
|
||||||
|
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
init();
|
init();
|
||||||
|
|
||||||
return that;
|
return that;
|
||||||
@@ -675,15 +694,19 @@ IPA.hbac.test_run_facet = function(spec) {
|
|||||||
|
|
||||||
var facet = that.entity.get_facet('user');
|
var facet = that.entity.get_facet('user');
|
||||||
facet.save(options);
|
facet.save(options);
|
||||||
|
if (!facet.validate(options)) return;
|
||||||
|
|
||||||
facet = that.entity.get_facet('targethost');
|
facet = that.entity.get_facet('targethost');
|
||||||
facet.save(options);
|
facet.save(options);
|
||||||
|
if (!facet.validate(options)) return;
|
||||||
|
|
||||||
facet = that.entity.get_facet('service');
|
facet = that.entity.get_facet('service');
|
||||||
facet.save(options);
|
facet.save(options);
|
||||||
|
if (!facet.validate(options)) return;
|
||||||
|
|
||||||
facet = that.entity.get_facet('sourcehost');
|
facet = that.entity.get_facet('sourcehost');
|
||||||
facet.save(options);
|
facet.save(options);
|
||||||
|
if (!facet.validate(options)) return;
|
||||||
|
|
||||||
facet = that.entity.get_facet('rules');
|
facet = that.entity.get_facet('rules');
|
||||||
facet.save(options);
|
facet.save(options);
|
||||||
|
|||||||
@@ -7,10 +7,87 @@
|
|||||||
{
|
{
|
||||||
"error": null,
|
"error": null,
|
||||||
"result": {
|
"result": {
|
||||||
|
"attributelevelrights": {
|
||||||
|
"aci": "rscwo",
|
||||||
|
"cmdcategory": "rscwo",
|
||||||
|
"cn": "rscwo",
|
||||||
|
"description": "rscwo",
|
||||||
|
"externalhost": "rscwo",
|
||||||
|
"externaluser": "rscwo",
|
||||||
|
"hostcategory": "rscwo",
|
||||||
|
"hostmask": "rscwo",
|
||||||
|
"ipaenabledflag": "rscwo",
|
||||||
|
"ipasudoopt": "rscwo",
|
||||||
|
"ipasudorunas": "rscwo",
|
||||||
|
"ipasudorunasextgroup": "rscwo",
|
||||||
|
"ipasudorunasextuser": "rscwo",
|
||||||
|
"ipasudorunasgroup": "rscwo",
|
||||||
|
"ipasudorunasgroupcategory": "rscwo",
|
||||||
|
"ipasudorunasusercategory": "rscwo",
|
||||||
|
"ipauniqueid": "rsc",
|
||||||
|
"memberallowcmd": "rscwo",
|
||||||
|
"memberdenycmd": "rscwo",
|
||||||
|
"memberhost": "rscwo",
|
||||||
|
"memberuser": "rscwo",
|
||||||
|
"nsaccountlock": "rscwo",
|
||||||
|
"usercategory": "rscwo"
|
||||||
|
},
|
||||||
"cn": [
|
"cn": [
|
||||||
"test"
|
"test"
|
||||||
],
|
],
|
||||||
"dn": "ipauniqueid=4fc57a02-f23311df-b268e50e-a3b3ef71,cn=sudorules,cn=sudo,dc=dev,dc=example,dc=com"
|
"dn": "ipauniqueid=4fc57a02-f23311df-b268e50e-a3b3ef71,cn=sudorules,cn=sudo,dc=dev,dc=example,dc=com",
|
||||||
|
"externalhost": [
|
||||||
|
"external.example.com"
|
||||||
|
],
|
||||||
|
"externaluser": [
|
||||||
|
"external"
|
||||||
|
],
|
||||||
|
"ipaenabledflag": [
|
||||||
|
"TRUE"
|
||||||
|
],
|
||||||
|
"ipasudoopt": [
|
||||||
|
"-H",
|
||||||
|
"-b"
|
||||||
|
],
|
||||||
|
"ipasudorunas_user": [
|
||||||
|
"admin"
|
||||||
|
],
|
||||||
|
"ipasudorunasgroup_group": [
|
||||||
|
"admins"
|
||||||
|
],
|
||||||
|
"ipauniqueid": [
|
||||||
|
"4fc57a02-f23311df-b268e50e-a3b3ef71"
|
||||||
|
],
|
||||||
|
"memberallowcmd_sudocmd": [
|
||||||
|
"/usr/bin/less"
|
||||||
|
],
|
||||||
|
"memberallowcmd_sudocmdgroup": [
|
||||||
|
"group1"
|
||||||
|
],
|
||||||
|
"memberdenycmd_sudocmd": [
|
||||||
|
"/usr/bin/more"
|
||||||
|
],
|
||||||
|
"memberdenycmd_sudocmdgroup": [
|
||||||
|
"group1",
|
||||||
|
"group2"
|
||||||
|
],
|
||||||
|
"memberhost_host": [
|
||||||
|
"dev.example.com"
|
||||||
|
],
|
||||||
|
"memberhost_hostgroup": [
|
||||||
|
"production",
|
||||||
|
"staging"
|
||||||
|
],
|
||||||
|
"memberuser_group": [
|
||||||
|
"editors"
|
||||||
|
],
|
||||||
|
"memberuser_user": [
|
||||||
|
"test"
|
||||||
|
],
|
||||||
|
"objectclass": [
|
||||||
|
"ipaassociation",
|
||||||
|
"ipasudorule"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"summary": null,
|
"summary": null,
|
||||||
"value": "test"
|
"value": "test"
|
||||||
|
|||||||
Reference in New Issue
Block a user