From 84b38b6793cbc45d36c39abf79893e22e90baac6 Mon Sep 17 00:00:00 2001 From: Pavel Vomacka Date: Mar 27 2017 16:48:51 +0000 Subject: WebUI: Allow to add certs to certmapping with CERT LINES around The certificate to the certmapping might be inserted as base64 encoded blob. This patch allows to also insert the certificate blob with surrounding "-----BEGIN CERTIFICATE-----" and "-----END CERTIFICATE-----" lines. This behavior is the same in widget for assigning certificates to users, so the change helps WebUI to be more consistent. https://pagure.io/freeipa/issue/6772 Reviewed-By: Florence Blanc-Renaud Reviewed-By: Petr Vobornik --- diff --git a/install/ui/src/freeipa/plugins/certmap.js b/install/ui/src/freeipa/plugins/certmap.js index ecbe095..c613601 100644 --- a/install/ui/src/freeipa/plugins/certmap.js +++ b/install/ui/src/freeipa/plugins/certmap.js @@ -8,6 +8,7 @@ define([ 'dojo/_base/declare', 'dojo/Evented', 'dojo/on', + '../certificate', '../navigation', '../field', '../ipa', @@ -19,8 +20,8 @@ define([ // plain imports '../search', '../entity'], - function(lang, declare, Evented, on, navigation, mod_field, IPA, - phases, reg, widget_mod, text, util) { + function(lang, declare, Evented, on, certificate, navigation, + mod_field, IPA, phases, reg, widget_mod, text, util) { /** * Certificate map module * @class @@ -312,6 +313,12 @@ certmap.certmap_multivalued_widget = function (spec) { var widget = widgets[0]; var inner_widgets = widget.widgets.get_widgets(); + var normalize_certs = function(certs) { + for (var k = 0, l = certs.length; k