You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by GitBox <gi...@apache.org> on 2021/09/16 18:01:19 UTC

[GitHub] [brooklyn-ui] jathanasiou commented on a change in pull request #290: Enhancement/sensitive field warning icon - regression fix

jathanasiou commented on a change in pull request #290:
URL: https://github.com/apache/brooklyn-ui/pull/290#discussion_r710353893



##########
File path: ui-modules/app-inspector/app/views/main/inspect/summary/summary.controller.js
##########
@@ -100,15 +101,10 @@ export function summaryController($scope, $state, $stateParams, $q, $http, $http
 
             // 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) =>
+                    isSensitiveFieldName(key.trim()) && !vm.config[key].toString().startsWith('$brooklyn:')

Review comment:
       the lodash `mapValues` (like most of its functions) is very resistant to "bad" values, so worse scenario we'll have an empty object for the config-sensor table, meaning no warning icons at all but everything else should be fine.
   
   ![image](https://user-images.githubusercontent.com/8679925/133661927-43252290-6079-4950-98f2-ddb00a3d8684.png)
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org