This is an automated email from the ASF dual-hosted git repository. heneveld pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/brooklyn-ui.git
commit cf5701398be17842aafb8eb1a2ec4af352e1a9b5 Merge: 8de45c7 c8bea0c Author: John Athanasiou <[email protected]> AuthorDate: Thu Sep 16 19:32:23 2021 +0300 Merge branch 'master' into enhancement/sensitive-field-warning-icon Jenkinsfile | 1 + modularity-server/external-modules/pom.xml | 3 +- .../brooklyn/ui/modularity/ExternalUiModule.java | 4 ++- modularity-server/metadata-registry/pom.xml | 1 + .../registry/impl/UiMetadataConfigListener.java | 7 ++-- .../config-sensor-table.directive.js | 6 ++-- .../main/inspect/summary/summary.controller.js | 4 +-- .../components/catalog-saver/catalog-saver.less | 6 ++++ .../catalog-saver.modal.template.html | 4 +-- .../providers/blueprint-service.provider.js | 41 ++++++++++++++++++---- .../spec-editor/spec-editor.directive.js | 4 +-- .../catalog/app/views/bundle/type/type.state.js | 1 + ui-modules/utils/quick-launch/quick-launch.js | 3 +- .../utils/sensitive-field/sensitive-field.js | 23 ++++++++++-- ui-modules/utils/server-status/server-status.js | 6 ++++ 15 files changed, 91 insertions(+), 23 deletions(-) diff --cc ui-modules/app-inspector/app/views/main/inspect/summary/summary.controller.js index c3919ad,c7895af..643f49d --- a/ui-modules/app-inspector/app/views/main/inspect/summary/summary.controller.js +++ b/ui-modules/app-inspector/app/views/main/inspect/summary/summary.controller.js @@@ -17,10 -17,10 +17,10 @@@ * under the License. */ import angular from "angular"; -import map from "lodash/map"; +import { map, mapValues } from "lodash"; import {HIDE_INTERSTITIAL_SPINNER_EVENT} from 'brooklyn-ui-utils/interstitial-spinner/interstitial-spinner'; import template from "./summary.template.html"; - import { SENSITIVE_FIELD_REGEX } from 'brooklyn-ui-utils/sensitive-field/sensitive-field'; + import { isSensitiveFieldName } from 'brooklyn-ui-utils/sensitive-field/sensitive-field'; export const summaryState = { name: 'main.inspect.summary', @@@ -101,10 -100,15 +101,10 @@@ export function summaryController($scop // TODO: ideally move this to a $watch block if (vm.config && vm.configResolved && vm.configInfo) { - vm.configItems = Object.entries(vm.showResolvedConfig ? vm.configResolved : vm.config) - .map(([key, value]) => ({ - key, - value, - // marking as unsafe if the field name looks sensitive - // and the unresolved value does *not* come from a secure external source - isUnsafe: isSensitiveFieldName(key.trim()) && - !vm.config[key].toString().startsWith('$brooklyn:'), - })); + vm.configItems = vm.showResolvedConfig ? vm.configResolved : vm.config; + vm.configItemsUnsafeMap = mapValues(vm.configItems, (value, key) => - SENSITIVE_FIELD_REGEX.test(key.trim()) && !vm.config[key].toString().startsWith('$brooklyn:') ++ isSensitiveFieldName(key.trim()) && !vm.config[key].toString().startsWith('$brooklyn:') + ); } }
