From 7d0fe13270e651fa69526488bcc951f248bc1d72 Mon Sep 17 00:00:00 2001 From: Alex Rudyy Date: Tue, 2 Dec 2014 10:56:37 +0000 Subject: 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 --- .../java/resources/addAuthenticationProvider.html | 2 +- .../authenticationprovider/external/add.html | 6 +- .../authenticationprovider/external/show.html | 26 ++++ .../authenticationprovider/filebased/add.html | 31 ++++ .../authenticationprovider/filebased/show.html | 26 ++++ .../authenticationprovider/passwordfile/add.html | 31 ---- .../authenticationprovider/simpleldap/add.html | 70 ++++----- .../authenticationprovider/simpleldap/show.html | 58 ++++++++ .../src/main/java/resources/js/qpid/common/util.js | 6 +- .../js/qpid/management/AuthenticationProvider.js | 156 ++++++++++----------- .../js/qpid/management/PreferencesProvider.js | 2 +- .../qpid/management/addAuthenticationProvider.js | 44 +++++- .../authenticationprovider/anonymous/show.js | 35 +++++ .../base64md5passwordfile/add.js | 4 +- .../base64md5passwordfile/show.js | 38 +++++ .../authenticationprovider/external/show.js | 38 +++++ .../authenticationprovider/kerberos/show.js | 35 +++++ .../management/authenticationprovider/md5/show.js | 35 +++++ .../authenticationprovider/plain/show.js | 35 +++++ .../plainpasswordfile/add.js | 4 +- .../plainpasswordfile/show.js | 38 +++++ .../authenticationprovider/scram-sha-1/show.js | 35 +++++ .../authenticationprovider/scram-sha-256/show.js | 35 +++++ .../authenticationprovider/simpleldap/add.js | 32 +++-- .../authenticationprovider/simpleldap/show.js | 43 ++++++ .../src/main/java/resources/showAuthProvider.html | 18 ++- .../java/resources/showPreferencesProvider.html | 1 - 27 files changed, 702 insertions(+), 182 deletions(-) create mode 100644 qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/external/show.html create mode 100644 qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/filebased/add.html create mode 100644 qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/filebased/show.html delete mode 100644 qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/passwordfile/add.html create mode 100644 qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/simpleldap/show.html create mode 100644 qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/anonymous/show.js create mode 100644 qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/base64md5passwordfile/show.js create mode 100644 qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/external/show.js create mode 100644 qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/kerberos/show.js create mode 100644 qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/md5/show.js create mode 100644 qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plain/show.js create mode 100644 qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/plainpasswordfile/show.js create mode 100644 qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-1/show.js create mode 100644 qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/scram-sha-256/show.js create mode 100644 qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/authenticationprovider/simpleldap/show.js (limited to 'qpid/java/broker-plugins/management-http/src/main') 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 @@
- +
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 @@
Use full DN:
-
+
+
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 @@ + +
+
+
Use full DN:
+
+
+
+
+ diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/filebased/add.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/filebased/add.html new file mode 100644 index 0000000000..53eb786722 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/filebased/add.html @@ -0,0 +1,31 @@ + +
+
Path*:
+
+ +
+
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 @@ + +
+
+
Path to file:
+
+
+
+
+ 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/passwordfile/add.html deleted file mode 100644 index 53eb786722..0000000000 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/authenticationprovider/passwordfile/add.html +++ /dev/null @@ -1,31 +0,0 @@ - -
-
Path*:
-
- -
-
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 @@ -30,6 +30,32 @@ promptMessage: 'LDAP server URL'"/> +
+
LDAP authentication URL
+
+ +
+
+
+
Trust Store:
+
+ +
+
Search context*:
@@ -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'"/>
@@ -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.'"/>
@@ -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'"/>
Search password:
- + promptMessage: 'The password to be used with the search username'"/>
-
Trust Store:
-
- -
-
-
-
Bind without search:
+
Authenticate without search:
-
+
+
LDAP Context Factory:
@@ -114,16 +130,4 @@ promptMessage: 'Fully qualified class name for LDAP Context Factory'"/>
-
-
LDAP authentication URL
-
- -
-
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 @@ + +
+
+
LDAP server URL:
+
+
+
+
Search context:
+
+
+
+
Search filter:
+
+
+
+
Search user name:
+
+
+
+
Search password:
+
+
+
+
Trust Store:
+
+
+
+
Bind without search:
+
+
+
+
LDAP Context Factory:
+
+
+
+
LDAP authentication URL:
+
+
+
+
+ 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 @@
State:
- +
- +
-
-
-
-
-
- -
-
+
+
+
+ +
+
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 @@
-
-- cgit v1.2.1