diff options
| author | Alex Rudyy <orudyy@apache.org> | 2014-12-02 10:56:37 +0000 |
|---|---|---|
| committer | Alex Rudyy <orudyy@apache.org> | 2014-12-02 10:56:37 +0000 |
| commit | 7d0fe13270e651fa69526488bcc951f248bc1d72 (patch) | |
| tree | cece1eefa017c2e2816686e7ef1fe3818a15f4ed /qpid/java/broker-plugins | |
| parent | 7b330757e5bcff063ebf9db23b9206a84bf78c95 (diff) | |
| download | qpid-python-7d0fe13270e651fa69526488bcc951f248bc1d72.tar.gz | |
QPID-6246: Display authentication provider specific fields on authentication provider tab
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1642841 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker-plugins')
26 files changed, 671 insertions, 151 deletions
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/addAuthenticationProvider.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/addAuthenticationProvider.html index ee9286e2f7..acc39569c1 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/addAuthenticationProvider.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/addAuthenticationProvider.html @@ -57,7 +57,7 @@ <div id="addPreferencesProvider.form" xxx-data-dojo-type="qpid/management/preferencesprovider/PreferencesProviderForm"></div> </div> <div class="dijitDialogPaneActionBar"> - <button data-dojo-type="dijit/form/Button" id="addAuthenticationProvider.addButton" data-dojo-props="label: 'Add'" type="submit"></button> + <button data-dojo-type="dijit/form/Button" id="addAuthenticationProvider.addButton" data-dojo-props="label: 'Save'" type="submit"></button> <button data-dojo-type="dijit/form/Button" id="addAuthenticationProvider.cancelButton" data-dojo-props="label: 'Cancel'" ></button> </div> </div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/external/add.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/external/add.html index 8c50252058..11a9bf8ea0 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/external/add.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/external/add.html @@ -19,8 +19,12 @@ <div class="clear"> <div class="formLabel-labelCell tableContainer-labelCell">Use full DN:</div> <div class="formLabel-controlCell tableContainer-valueCell"> - <input type="text" class="useFullDN" + <input type="text" class="useFullDN" id="external.useFullDN" data-dojo-type="dijit/form/CheckBox" data-dojo-props=" name: 'useFullDN' " /> </div> + <div data-dojo-type="dijit/Tooltip" + data-dojo-props="connectId: ['external.useFullDN'], + label: 'If selected, full distinguished name will be used as principal name'"> + </div> </div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/external/show.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/external/show.html new file mode 100644 index 0000000000..ac065c723c --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/external/show.html @@ -0,0 +1,26 @@ +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + --> +<div> + <div class="clear"> + <div class="formLabel-labelCell">Use full DN:</div> + <div ><span class="useFullDN" ></span></div> + </div> + <div class="clear"></div> +</div> + diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/passwordfile/add.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/filebased/add.html index 53eb786722..53eb786722 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/passwordfile/add.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/filebased/add.html diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/filebased/show.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/filebased/show.html new file mode 100644 index 0000000000..5060656964 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/filebased/show.html @@ -0,0 +1,26 @@ +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + --> +<div> + <div class="clear"> + <div class="formLabel-labelCell">Path to file:</div> + <div ><span class="path" ></span></div> + </div> + <div class="clear"></div> +</div> + diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/simpleldap/add.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/simpleldap/add.html index 16463565e3..3a3b613564 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/simpleldap/add.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/simpleldap/add.html @@ -31,6 +31,32 @@ </div> </div> <div class="clear"> + <div class="formLabel-labelCell tableContainer-labelCell">LDAP authentication URL</div> + <div class="formLabel-controlCell tableContainer-valueCell"> + <input type="text" class="providerAuthUrl" + data-dojo-type="dijit/form/ValidationTextBox" + data-dojo-props=" + name: 'providerAuthUrl', + placeHolder: 'ldap://host:port', + title: 'Enter optional LDAP authentication URL', + promptMessage: 'URL of LDAP server for performing \'ldap bind\'. If not specified, the LDAP server URL will be used for both searches and authentications'"/> + </div> + </div> + <div class="clear"> + <div class="formLabel-labelCell tableContainer-labelCell">Trust Store:</div> + <div class="tableContainer-valueCell formLabel-controlCell"> + <select class="trustStore" data-dojo-type="dijit/form/FilteringSelect" + data-dojo-props=" + required: false, + name: 'trustStore', + placeHolder: 'Select trust store', + promptMessage: 'Select the trust store containing the certificate of the CA that signs to LDAP servers certificate', + title: 'Select trust store for secure connection', + searchAttr: 'name'"> + </select> + </div> + </div> + <div class="clear"> <div class="formLabel-labelCell tableContainer-labelCell">Search context*:</div> <div class="formLabel-controlCell tableContainer-valueCell"> <input type="text" class="searchContext" @@ -40,7 +66,7 @@ required: true, placeHolder: 'dc=users,dc=example,dc=com', title: 'Enter search context', - promptMessage: 'The distinguished name of the search base object'"/> + promptMessage: 'Identifies the entry that is the base of the subtree containing users'"/> </div> </div> <div class="clear"> @@ -53,7 +79,7 @@ required: true, placeHolder: '(uid={0})', title: 'Enter user search filter ', - promptMessage: 'DN template to find an LDAP user entry by provided user name'"/> + promptMessage: 'Filter expression used to locate users within the subtree. {0} will be replaced by the user id.'"/> </div> </div> <div class="clear"> @@ -65,43 +91,33 @@ name: 'searchUsername', placeHolder: 'username', title: 'Enter username for authenticated search', - promptMessage: 'Username for authenticated search'"/> + promptMessage: 'The username used to authenticate to the directory in order to perform the search. If not specified, an anonymous bind is used to perform the search'"/> </div> </div> <div class="clear"> <div class="formLabel-labelCell tableContainer-labelCell">Search password:</div> <div class="formLabel-controlCell tableContainer-valueCell"> - <input type="text" class="searchPassword" + <input type="password" class="searchPassword" data-dojo-type="dijit/form/ValidationTextBox" data-dojo-props=" name: 'searchPassword', placeHolder: '****', title: 'Enter password for authenticated search', - promptMessage: 'Password for authenticated search'"/> + promptMessage: 'The password to be used with the search username'"/> </div> </div> <div class="clear"> - <div class="formLabel-labelCell tableContainer-labelCell">Trust Store:</div> - <div class="tableContainer-valueCell formLabel-controlCell"> - <select class="trustStore" data-dojo-type="dijit/form/FilteringSelect" - data-dojo-props=" - required: false, - name: 'trustStore', - placeHolder: 'Select trust store', - promptMessage: 'Trust store containing certificate for SSL transport', - title: 'Select trust store for secure connection', - searchAttr: 'name'"> - </select> - </div> - </div> - <div class="clear"> - <div class="formLabel-labelCell tableContainer-labelCell">Bind without search:</div> + <div class="formLabel-labelCell tableContainer-labelCell">Authenticate without search:</div> <div class="formLabel-controlCell tableContainer-valueCell"> - <input type="text" class="bindWithoutSearch" + <input type="text" class="bindWithoutSearch" id="addAuthenticationProvider.simpleldap.bindWithoutSearch" data-dojo-type="dijit/form/CheckBox" data-dojo-props=" name: 'bindWithoutSearch' " /> </div> </div> + <div data-dojo-type="dijit/Tooltip" + data-dojo-props="connectId: ['addAuthenticationProvider.simpleldap.bindWithoutSearch'], + label: 'If selected, the provider will not search the directory'"> + </div> <div class="clear"> <div class="formLabel-labelCell tableContainer-labelCell">LDAP Context Factory:</div> <div class="formLabel-controlCell tableContainer-valueCell"> @@ -114,16 +130,4 @@ promptMessage: 'Fully qualified class name for LDAP Context Factory'"/> </div> </div> - <div class="clear"> - <div class="formLabel-labelCell tableContainer-labelCell">LDAP authentication URL</div> - <div class="formLabel-controlCell tableContainer-valueCell"> - <input type="text" class="providerAuthUrl" - data-dojo-type="dijit/form/ValidationTextBox" - data-dojo-props=" - name: 'providerAuthUrl', - placeHolder: 'ldap://host:port', - title: 'Enter optional LDAP authentication URL', - promptMessage: 'URL of LDAP server for performing \'ldap bind\'. If not specified, the LDAP server URL will be used for both searches and authentications'"/> - </div> - </div> </div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/simpleldap/show.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/simpleldap/show.html new file mode 100644 index 0000000000..e2f1da32af --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/simpleldap/show.html @@ -0,0 +1,58 @@ +<!-- + ~ Licensed to the Apache Software Foundation (ASF) under one + ~ or more contributor license agreements. See the NOTICE file + ~ distributed with this work for additional information + ~ regarding copyright ownership. The ASF licenses this file + ~ to you under the Apache License, Version 2.0 (the + ~ "License"); you may not use this file except in compliance + ~ with the License. You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, + ~ software distributed under the License is distributed on an + ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ KIND, either express or implied. See the License for the + ~ specific language governing permissions and limitations + ~ under the License. + --> +<div> + <div class="clear"> + <div class="formLabel-labelCell">LDAP server URL:</div> + <div ><span class="providerUrl" ></span></div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Search context:</div> + <div><span class="searchContext" ></span></div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Search filter:</div> + <div><span class="searchFilter" ></span></div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Search user name:</div> + <div><span class="searchUsername" ></span></div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Search password:</div> + <div><span class="searchPassword" ></span></div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Trust Store:</div> + <div><span class="trustStore" ></span></div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">Bind without search:</div> + <div><span class="bindWithoutSearch" ></span></div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">LDAP Context Factory:</div> + <div><span class="ldapContextFactory" ></span></div> + </div> + <div class="clear"> + <div class="formLabel-labelCell">LDAP authentication URL:</div> + <div><span class="providerAuthUrl" ></span></div> + </div> + <div class="clear"></div> +</div> + diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js index 53340edc85..60be40b62b 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js @@ -570,7 +570,11 @@ define(["dojo/_base/xhr", { var fieldName = fieldNames[i]; var value = data[fieldName]; - obj[fieldName].innerHTML= (value == undefined || value == null) ? "" : entities.encode(String(value)); + var fieldNode = obj[fieldName]; + if (fieldNode) + { + fieldNode.innerHTML= (value == undefined || value == null) ? "" : entities.encode(String(value)); + } } } diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AuthenticationProvider.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AuthenticationProvider.js index 0653c8fad7..79850b92fb 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AuthenticationProvider.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/AuthenticationProvider.js @@ -59,17 +59,17 @@ define(["dojo/_base/xhr", contentPane.containerNode.innerHTML = data; parser.parse(contentPane.containerNode); - that.authProviderUpdater = new AuthProviderUpdater(contentPane.containerNode, that.modelObj, that.controller, that); + var authProviderUpdater = new AuthProviderUpdater(contentPane.containerNode, that.modelObj, that.controller, that); + that.authProviderUpdater = authProviderUpdater; - that.authProviderUpdater.update(); - - var editButton = query(".editAuthenticationProviderButton", contentPane.containerNode)[0]; - var editWidget = registry.byNode(editButton); - connect.connect(editWidget, "onClick", + var editButtonNode = query(".editAuthenticationProviderButton", contentPane.containerNode)[0]; + var editButtonWidget = registry.byNode(editButtonNode); + editButtonWidget.on("click", function(evt){ event.stop(evt); - addAuthenticationProvider.show(that.name); + addAuthenticationProvider.show(authProviderUpdater.authProviderData); }); + authProviderUpdater.editButton = editButtonWidget; var deleteButton = query(".deleteAuthenticationProviderButton", contentPane.containerNode)[0]; var deleteWidget = registry.byNode(deleteButton); @@ -86,6 +86,25 @@ define(["dojo/_base/xhr", event.stop(evt); that.addPreferencesProvider(); }); + + authProviderUpdater.update(); + if (util.isProviderManagingUsers(authProviderUpdater.authProviderData.type)) + { + authProviderUpdater.managingUsersUI = new PrincipalDatabaseAuthenticationManager(contentPane.containerNode, authProviderUpdater.authProviderData, that.controller); + authProviderUpdater.managingUsersUI.update(authProviderUpdater.authProviderData); + } + + if (!util.supportsPreferencesProvider(authProviderUpdater.authProviderData.type)) + { + var authenticationProviderPanel = registry.byNode( query(".preferencesPanel", contentPane.containerNode)[0]); + domStyle.set(authenticationProviderPanel.domNode, "display","none"); + } + else + { + var preferencesProviderData = authProviderUpdater.authProviderData.preferencesproviders? authProviderUpdater.authProviderData.preferencesproviders[0]: null; + authProviderUpdater.updatePreferencesProvider(preferencesProviderData); + } + updater.add( that.authProviderUpdater ); }}); }; @@ -140,43 +159,10 @@ define(["dojo/_base/xhr", this.deletePreferencesProviderButton = query(".deletePreferencesProviderButton", node)[0]; this.preferencesProviderAttributes = dom.byId("preferencesProviderAttributes") this.preferencesNode = query(".preferencesProviderDetails", node)[0]; + this.authenticationProviderDetailsContainer = query(".authenticationProviderDetails", node)[0]; this.query = "api/latest/authenticationprovider/" + encodeURIComponent(authProviderObj.name); - var that = this; - - xhr.get({url: this.query, sync: properties.useSyncGet, handleAs: "json"}) - .then(function(data) - { - that.authProviderData = data[0]; - - util.flattenStatistics( that.authProviderData ); - - that.updateHeader(); - - var editButton = query(".editAuthenticationProviderButton", node)[0]; - var editWidget = registry.byNode(editButton); - var hideEdit = (that.authProviderData.type === 'Anonymous' || that.authProviderData.type === 'External' || that.authProviderData.type === 'Kerberos') - domStyle.set(editWidget.domNode, "display", hideEdit ? "none": ""); - - if (util.isProviderManagingUsers(that.authProviderData.type)) - { - that.details = new PrincipalDatabaseAuthenticationManager(node, that.authProviderData, controller); - that.details.update(that.authProviderData); - } - if (that.authProviderData.type == "Anonymous") - { - var authenticationProviderPanel = registry.byNode( query(".preferencesPanel", node)[0]); - domStyle.set(authenticationProviderPanel.domNode, "display","none"); - } - else - { - var preferencesProviderData = that.authProviderData.preferencesproviders? that.authProviderData.preferencesproviders[0]: null; - - that.updatePreferencesProvider(preferencesProviderData); - } - }); - } AuthProviderUpdater.prototype.updatePreferencesProvider = function(preferencesProviderData) @@ -186,8 +172,9 @@ define(["dojo/_base/xhr", this.addPreferencesProviderButton.style.display = 'none'; if (!this.preferencesProvider) { - this.preferencesProvider=new PreferencesProvider(preferencesProviderData.name, this.authProviderData); - this.preferencesProvider.init(this.preferencesNode); + var preferencesProvider =new PreferencesProvider(preferencesProviderData.name, this.authProviderData); + preferencesProvider.init(this.preferencesNode); + this.preferencesProvider = preferencesProvider; } this.preferencesProvider.update(preferencesProviderData); } @@ -212,45 +199,58 @@ define(["dojo/_base/xhr", AuthProviderUpdater.prototype.update = function() { var that = this; + xhr.get({url: this.query, sync: true, handleAs: "json"}).then(function(data) {that._update(data[0]);}); + }; + + AuthProviderUpdater.prototype._update = function(data) + { + var that = this; + this.authProviderData = data; + util.flattenStatistics(data ); + this.updateHeader(); - xhr.get({url: this.query, sync: properties.useSyncGet, handleAs: "json"}) - .then(function(data) { - that.authProviderData = data[0]; - that.name = data[0].name - util.flattenStatistics( that.authProviderData ); - that.updateHeader(); - if (that.details) - { - try - { - that.details.update(that.authProviderData); - } - catch(e) - { - if (console) + if (this.details) + { + this.details.update(data); + } + else + { + require(["qpid/management/authenticationprovider/" + encodeURIComponent(data.type.toLowerCase()) + "/show"], + function(DetailsUI) { - console.error(e); + that.details = new DetailsUI({containerNode:that.authenticationProviderDetailsContainer, parent: that}); + that.details.update(data); } - } - } - var preferencesProviderData = that.authProviderData.preferencesproviders? that.authProviderData.preferencesproviders[0]: null; - try - { - that.updatePreferencesProvider(preferencesProviderData); - } - catch(e) - { - if (console) - { - console.error(e); - } - } - }); - - - }; - + ); + } + if (this.managingUsersUI) + { + try + { + this.managingUsersUI.update(data); + } + catch(e) + { + if (console) + { + console.error(e); + } + } + } + var preferencesProviderData = data.preferencesproviders? data.preferencesproviders[0]: null; + try + { + this.updatePreferencesProvider(preferencesProviderData); + } + catch(e) + { + if (console) + { + console.error(e); + } + } + } return AuthenticationProvider; }); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProvider.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProvider.js index d7b028f1a5..41588e20c2 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProvider.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProvider.js @@ -64,12 +64,12 @@ define(["dojo/_base/xhr", var deletePreferencesProviderWidget = registry.byNode(that.deletePreferencesProviderButton); deletePreferencesProviderWidget.on("click", function(evt){ event.stop(evt); that.deletePreferencesProvider();}); }}); - this.reload(); }; PreferencesProvider.prototype.open = function(contentPane) { this.contentPane = contentPane; this.init(contentPane.containerNode); + this.reload(); this.updater = new PreferencesProviderUpdater(this); updater.add(this.updater); }; diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js index 51f2acb685..f42a7843ee 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js @@ -58,8 +58,8 @@ define(["dojo/_base/xhr", this.containerNode = construct.create("div", {innerHTML: template}); parser.parse(this.containerNode); - var authenticationProviderName = registry.byId("addAuthenticationProvider.name"); - authenticationProviderName.set("regExpGen", util.nameOrContextVarRegexp); + this.authenticationProviderName = registry.byId("addAuthenticationProvider.name"); + this.authenticationProviderName.set("regExpGen", util.nameOrContextVarRegexp); this.dialog = registry.byId("addAuthenticationProvider"); this.addButton = registry.byId("addAuthenticationProvider.addButton"); @@ -79,11 +79,42 @@ define(["dojo/_base/xhr", this.preferencesProviderForm = new qpid.preferencesprovider.PreferencesProviderForm({disabled: true}); this.preferencesProviderForm.placeAt(dom.byId("addPreferencesProvider.form")); }, - show:function(providerName) + show:function(effectiveData) { this.authenticationProviderForm.reset(); this.preferencesProviderForm.reset(); + if (effectiveData) + { + // editing + var actualData = null; + xhr.get( + { + url: "api/latest/authenticationprovider/" + encodeURIComponent(effectiveData.name), + sync: true, + content: { actuals: true }, + handleAs: "json", + load: function(data) + { + actualData = data[0]; + } + } + ); + this.initialData = actualData; + this.effectiveData = effectiveData; + this.authenticationProviderType.set("value", actualData.type); + this.authenticationProviderName.set("value", actualData.name); + this.authenticationProviderType.set("disabled", true); + this.authenticationProviderName.set("disabled", true); + } + else + { + this.authenticationProviderType.set("disabled", false); + this.authenticationProviderName.set("disabled", false); + this.initialData = {}; + this.effectiveData = {}; + } + this.dialog.show(); if (!this.resizeEventRegistered) { @@ -107,9 +138,9 @@ define(["dojo/_base/xhr", { var success = false,failureReason=null; - var authenticationProviderData = util.getFormWidgetValues(this.authenticationProviderForm); // TODO initialValues + var authenticationProviderData = util.getFormWidgetValues(this.authenticationProviderForm, this.initialData); - var encodedAuthenticationProviderName = encodeURIComponent(authenticationProviderData.name); + var encodedAuthenticationProviderName = encodeURIComponent(this.authenticationProviderName.value); xhr.put({ url: "api/latest/authenticationprovider/" + encodedAuthenticationProviderName, sync: true, @@ -149,6 +180,7 @@ define(["dojo/_base/xhr", { var widgets = registry.findWidgets(typeFieldsContainer); array.forEach(widgets, function(item) { item.destroyRecursive();}); + construct.empty(typeFieldsContainer); this.preferencesProviderForm.set("disabled", !type || !util.supportsPreferencesProvider(type)); if (type) { @@ -157,7 +189,7 @@ define(["dojo/_base/xhr", { try { - typeUI.show({containerNode:typeFieldsContainer, parent: that}); + typeUI.show({containerNode:typeFieldsContainer, parent: that, data: that.initialData, effectiveData: that.effectiveData}); util.applyMetadataToWidgets(typeFieldsContainer, category, type); } catch(e) diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/anonymous/show.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/anonymous/show.js new file mode 100644 index 0000000000..ca2b56fda0 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/anonymous/show.js @@ -0,0 +1,35 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +define([], + function () + { + + function NoFieldAuthenticationProvider(data) + { + } + + NoFieldAuthenticationProvider.prototype.update = function(data) + { + } + + return NoFieldAuthenticationProvider; + } +); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/base64md5passwordfile/add.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/base64md5passwordfile/add.js index b1beadb489..a593b14fd6 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/base64md5passwordfile/add.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/base64md5passwordfile/add.js @@ -24,11 +24,11 @@ define(["dojo/query","dijit/registry","qpid/common/util"], return { show: function(data) { - util.parseHtmlIntoDiv(data.containerNode, "authenticationprovider/passwordfile/add.html"); + util.parseHtmlIntoDiv(data.containerNode, "authenticationprovider/filebased/add.html"); if (data.data) { var path = registry.byNode(query(".path", data.containerNode)[0]); - path.set("value", data.data.useFullDN); + path.set("value", data.data.path); } } }; diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/base64md5passwordfile/show.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/base64md5passwordfile/show.js new file mode 100644 index 0000000000..1456a4847c --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/base64md5passwordfile/show.js @@ -0,0 +1,38 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +define(["qpid/common/util", "dojo/domReady!"], + function (util, metadata) + { + + function Base64MD5PasswordFile(data) + { + util.buildUI(data.containerNode, data.parent, "authenticationprovider/filebased/show.html", ["path"], this); + data.parent.editButton.set("disabled", false); + } + + Base64MD5PasswordFile.prototype.update = function(data) + { + util.updateUI(data, ["path"], this); + } + + return Base64MD5PasswordFile; + } +); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/external/show.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/external/show.js new file mode 100644 index 0000000000..84b1ed387d --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/external/show.js @@ -0,0 +1,38 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +define(["qpid/common/util", "dojo/domReady!"], + function (util, metadata) + { + + function External(data) + { + util.buildUI(data.containerNode, data.parent, "authenticationprovider/external/show.html", ["useFullDN"], this); + data.parent.editButton.set("disabled", false); + } + + External.prototype.update = function(data) + { + util.updateUI(data, ["useFullDN"], this); + } + + return External; + } +); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/kerberos/show.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/kerberos/show.js new file mode 100644 index 0000000000..ca2b56fda0 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/kerberos/show.js @@ -0,0 +1,35 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +define([], + function () + { + + function NoFieldAuthenticationProvider(data) + { + } + + NoFieldAuthenticationProvider.prototype.update = function(data) + { + } + + return NoFieldAuthenticationProvider; + } +); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/md5/show.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/md5/show.js new file mode 100644 index 0000000000..ca2b56fda0 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/md5/show.js @@ -0,0 +1,35 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +define([], + function () + { + + function NoFieldAuthenticationProvider(data) + { + } + + NoFieldAuthenticationProvider.prototype.update = function(data) + { + } + + return NoFieldAuthenticationProvider; + } +); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plain/show.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plain/show.js new file mode 100644 index 0000000000..ca2b56fda0 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plain/show.js @@ -0,0 +1,35 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +define([], + function () + { + + function NoFieldAuthenticationProvider(data) + { + } + + NoFieldAuthenticationProvider.prototype.update = function(data) + { + } + + return NoFieldAuthenticationProvider; + } +); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plainpasswordfile/add.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plainpasswordfile/add.js index b1beadb489..a593b14fd6 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plainpasswordfile/add.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plainpasswordfile/add.js @@ -24,11 +24,11 @@ define(["dojo/query","dijit/registry","qpid/common/util"], return { show: function(data) { - util.parseHtmlIntoDiv(data.containerNode, "authenticationprovider/passwordfile/add.html"); + util.parseHtmlIntoDiv(data.containerNode, "authenticationprovider/filebased/add.html"); if (data.data) { var path = registry.byNode(query(".path", data.containerNode)[0]); - path.set("value", data.data.useFullDN); + path.set("value", data.data.path); } } }; diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plainpasswordfile/show.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plainpasswordfile/show.js new file mode 100644 index 0000000000..f428a8ec55 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plainpasswordfile/show.js @@ -0,0 +1,38 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +define(["qpid/common/util", "dojo/domReady!"], + function (util, metadata) + { + + function PlainPasswordFile(data) + { + util.buildUI(data.containerNode, data.parent, "authenticationprovider/filebased/show.html", ["path"], this); + data.parent.editButton.set("disabled", false); + } + + PlainPasswordFile.prototype.update = function(data) + { + util.updateUI(data, ["path"], this); + } + + return PlainPasswordFile; + } +); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-1/show.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-1/show.js new file mode 100644 index 0000000000..ca2b56fda0 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-1/show.js @@ -0,0 +1,35 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +define([], + function () + { + + function NoFieldAuthenticationProvider(data) + { + } + + NoFieldAuthenticationProvider.prototype.update = function(data) + { + } + + return NoFieldAuthenticationProvider; + } +); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-256/show.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-256/show.js new file mode 100644 index 0000000000..ca2b56fda0 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-256/show.js @@ -0,0 +1,35 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +define([], + function () + { + + function NoFieldAuthenticationProvider(data) + { + } + + NoFieldAuthenticationProvider.prototype.update = function(data) + { + } + + return NoFieldAuthenticationProvider; + } +); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/simpleldap/add.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/simpleldap/add.js index 1334ea14fa..2c0dc688e9 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/simpleldap/add.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/simpleldap/add.js @@ -28,15 +28,15 @@ define(["dojo/_base/xhr","dojo/query","dijit/registry","qpid/common/util","qpid/ var that = this; xhr.get({url: "api/latest/truststore", sync: true, handleAs: "json"}).then( - function(data) + function(trustStores) { - that._initTrustStores(data,data.containerNode); + that._initTrustStores(trustStores, data.containerNode); } ); if (data.data) { - this._initFields(data.data); + this._initFields(data.data, data.containerNode ); } }, _initTrustStores: function(trustStores, containerNode) @@ -48,29 +48,31 @@ define(["dojo/_base/xhr","dojo/query","dijit/registry","qpid/common/util","qpid/ } var trustStoresStore = new Memory({ data: data }); - var trustStore = registry.byNode(query(".trustStore", data.containerNode)[0]); + var trustStore = registry.byNode(query(".trustStore", containerNode)[0]); trustStore.set("store", trustStoresStore); }, - _initFields:function(data) + _initFields:function(data, containerNode) { var attributes = metadata.getMetaData("AuthenticationProvider", "SimpleLDAP").attributes; for(var name in attributes) { - var widget = registry.byNode(query("." + name, data.containerNode)[0]); - if (widget) + var domNode = query("." + name, containerNode)[0]; + if (domNode) { - if (widget instanceof dijit.form.CheckBox) + var widget = registry.byNode(domNode); + if (widget) { - widget.set("checked", data[name]); - } - else - { - widget.set("value", data[name]); + if (widget instanceof dijit.form.CheckBox) + { + widget.set("checked", data[name]); + } + else + { + widget.set("value", data[name]); + } } } } - var bindWithoutSearch = - bindWithoutSearch.set("checked", data.data.bindWithoutSearch); } }; } diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/simpleldap/show.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/simpleldap/show.js new file mode 100644 index 0000000000..554e856035 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/simpleldap/show.js @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +define(["qpid/common/util", "qpid/common/metadata", "dojo/domReady!"], + function (util, metadata) + { + + function SimpleLdapAuthenticationProvider(data) + { + this.fields = []; + var attributes = metadata.getMetaData("AuthenticationProvider", "SimpleLDAP").attributes; + for(var name in attributes) + { + this.fields.push(name); + } + util.buildUI(data.containerNode, data.parent, "authenticationprovider/simpleldap/show.html", this.fields, this); + data.parent.editButton.set("disabled", false); + } + + SimpleLdapAuthenticationProvider.prototype.update = function(data) + { + util.updateUI(data, this.fields, this); + } + + return SimpleLdapAuthenticationProvider; + } +); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/showAuthProvider.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/showAuthProvider.html index 3a5195c654..362110a163 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/showAuthProvider.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/showAuthProvider.html @@ -32,19 +32,17 @@ <div class="formLabel-labelCell">State:</div> <div class="state"></div> </div> - + <div class="clear authenticationProviderDetails"></div> <div class="clear"></div> <div class="clear dijitDialogPaneActionBar"> - <button data-dojo-type="dijit.form.Button" class="editAuthenticationProviderButton" type="button">Edit</button> + <button data-dojo-type="dijit.form.Button" class="editAuthenticationProviderButton" type="button" data-dojo-props="disabled: true">Edit</button> <button data-dojo-type="dijit.form.Button" class="deleteAuthenticationProviderButton" type="button">Delete</button> </div> - <br/> - <br/> - <div class="clear"></div> - <div class="clear preferencesPanel" data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Preferences Provider', open: true"> - <div class="preferencesProviderDetails"></div> - <button data-dojo-type="dijit.form.Button" class="addPreferencesProviderButton">Add</button> - </div> - <br/> </div> + <br/> + <div class="clear preferencesPanel" data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Preferences Provider', open: true"> + <div class="preferencesProviderDetails"></div> + <button data-dojo-type="dijit.form.Button" class="addPreferencesProviderButton">Add</button> + </div> + <br/> </div> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/showPreferencesProvider.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/showPreferencesProvider.html index 2c4f2bb01b..9a8e651192 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/showPreferencesProvider.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/showPreferencesProvider.html @@ -34,7 +34,6 @@ </div> <div class="preferencesDetails"></div> </div> - <br/> <div class="clear"></div> <div class="clear dijitDialogPaneActionBar"> <button data-dojo-type="dijit.form.Button" class="editPreferencesProviderButton">Edit</button> |
