You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2019/12/13 01:47:08 UTC

[ambari] branch branch-2.7 updated: AMBARI-25448. Mask credentials during install step

This is an automated email from the ASF dual-hosted git repository.

alexantonenko pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
     new 3bdfc84  AMBARI-25448. Mask credentials during install step
     new 952d4d8  Merge pull request #3162 from hiveww/AMBARI-25448-branch-2.7
3bdfc84 is described below

commit 3bdfc847e550a29723bd4c0fd97fbb74cec9fb01
Author: hiveww <hi...@gmail.com>
AuthorDate: Fri Dec 13 01:48:23 2019 +0300

    AMBARI-25448. Mask credentials during install step
---
 ambari-web/app/templates/wizard/step8.hbs |  2 +-
 ambari-web/app/views/wizard/step8_view.js | 27 ++++++++++++++++++++++++++-
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/ambari-web/app/templates/wizard/step8.hbs b/ambari-web/app/templates/wizard/step8.hbs
index 00a97fe..37b16d9 100644
--- a/ambari-web/app/templates/wizard/step8.hbs
+++ b/ambari-web/app/templates/wizard/step8.hbs
@@ -48,7 +48,7 @@
           {{else}}
             <div>
               <ul>
-                {{#each item in controller.clusterInfo.repoInfo}}
+                {{#each item in view.repoInfo}}
                   <li>
                     <p><span class="text text-info">{{item.os_type}} ({{item.repo_id}}): <br/></span>{{item.base_url}}</p>
                   </li>
diff --git a/ambari-web/app/views/wizard/step8_view.js b/ambari-web/app/views/wizard/step8_view.js
index 3176f46..4c4733d 100644
--- a/ambari-web/app/views/wizard/step8_view.js
+++ b/ambari-web/app/views/wizard/step8_view.js
@@ -34,6 +34,31 @@ App.WizardStep8View = Em.View.extend({
   printReview: function () {
     var o = $("#step8-info");
     o.jqprint();
-  }
+  },
+
+  repoInfo: function() {
+    var repoInfo = this.get('controller.clusterInfo.repoInfo');
+    if (!repoInfo) {
+      return [];
+    }
+    return repoInfo.map(function (item) {
+      var link = item.get('base_url');
+      try {
+        var urlObject = new URL(link);
+        if (urlObject.username && urlObject.password) {
+          urlObject.username = urlObject.username.replace(/./g, "*");
+          urlObject.password = urlObject.password.replace(/./g, "*");
+          link = urlObject.toString();
+        }
+      } catch (e) {
+      }
+
+      return {
+        os_type: item.get('os_type'),
+        repo_id: item.get('repo_id'),
+        base_url: link
+      };
+    });
+  }.property('controller.clusterInfo.repoInfo')
 });