You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by wu...@apache.org on 2022/11/28 14:23:13 UTC

[ambari] branch trunk updated: AMBARI-25419: Add option to disable URL credential auto-update behaviour (#3582)

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

wuzhiguo pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 0a781a9483 AMBARI-25419: Add option to disable URL credential auto-update behaviour (#3582)
0a781a9483 is described below

commit 0a781a94830dad67f38129510a8a86bf1281d165
Author: Zhiguo Wu <wu...@apache.org>
AuthorDate: Mon Nov 28 22:23:08 2022 +0800

    AMBARI-25419: Add option to disable URL credential auto-update behaviour (#3582)
---
 .../scripts/controllers/stackVersions/StackVersionsCreateCtrl.js   | 7 +++++--
 .../app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js | 5 ++++-
 ambari-web/app/config.js                                           | 1 +
 ambari-web/app/views/wizard/step1_view.js                          | 2 +-
 4 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
index 6fa434c390..808a085b57 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsCreateCtrl.js
@@ -18,8 +18,8 @@
 'use strict';
 
 angular.module('ambariAdminConsole')
-.controller('StackVersionsCreateCtrl', ['$scope', 'Stack', 'Utility', '$routeParams', '$location', '$timeout' ,'Alert', '$translate', 'Cluster', 'AddRepositoryModal', 'AddVersionModal', 'ConfirmationModal',
-    function($scope, Stack, Utility, $routeParams, $location, $timeout, Alert, $translate, Cluster, AddRepositoryModal, AddVersionModal, ConfirmationModal) {
+.controller('StackVersionsCreateCtrl', ['$scope', '$rootScope', 'Stack', 'Utility', '$routeParams', '$location', '$timeout' ,'Alert', '$translate', 'Cluster', 'AddRepositoryModal', 'AddVersionModal', 'ConfirmationModal',
+    function($scope, $rootScope, Stack, Utility, $routeParams, $location, $timeout, Alert, $translate, Cluster, AddRepositoryModal, AddVersionModal, ConfirmationModal) {
   var $t = $translate.instant;
   $scope.constants = {
     os: $t('versions.os')
@@ -444,6 +444,9 @@ angular.module('ambariAdminConsole')
   };
 
   $scope.setUsernameAndPasswordsIfNeeded = function(repo) {
+    if ($rootScope.supports.disableCredentialsAutocompleteForRepoUrls) {
+      return;
+    }
     try {
       var urlObject = new URL(repo.Repositories.base_url);
       var username = urlObject.username;
diff --git a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
index 5452c60ce8..eaeedbc81e 100644
--- a/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
+++ b/ambari-admin/src/main/resources/ui/admin-web/app/scripts/controllers/stackVersions/StackVersionsEditCtrl.js
@@ -18,7 +18,7 @@
 'use strict';
 
 angular.module('ambariAdminConsole')
-.controller('StackVersionsEditCtrl', ['$scope', '$location', 'Cluster', 'Stack', '$routeParams', 'ConfirmationModal', 'Alert', '$translate', 'AddRepositoryModal', function($scope, $location, Cluster, Stack, $routeParams, ConfirmationModal, Alert, $translate, AddRepositoryModal) {
+.controller('StackVersionsEditCtrl', ['$scope', '$rootScope', '$location', 'Cluster', 'Stack', '$routeParams', 'ConfirmationModal', 'Alert', '$translate', 'AddRepositoryModal', function($scope, $rootScope, $location, Cluster, Stack, $routeParams, ConfirmationModal, Alert, $translate, AddRepositoryModal) {
   var $t = $translate.instant;
   $scope.constants = {
     os: $t('versions.os')
@@ -323,6 +323,9 @@ angular.module('ambariAdminConsole')
   };
 
   $scope.onRepoUrlChange = function(repo) {
+    if ($rootScope.supports.disableCredentialsAutocompleteForRepoUrls) {
+      return;
+    }
     try {
       var urlObject = new URL(repo.Repositories.base_url);
       var username = urlObject.username;
diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js
index 7a17ab97c8..012c280e21 100644
--- a/ambari-web/app/config.js
+++ b/ambari-web/app/config.js
@@ -93,6 +93,7 @@ App.supports = {
   enableToggleKerberos: true,
   enableAddDeleteServices: true,
   regenerateKeytabsOnSingleHost: false,
+  disableCredentialsAutocompleteForRepoUrls: false,
   enableNewServiceRestartOptions: false
 };
 
diff --git a/ambari-web/app/views/wizard/step1_view.js b/ambari-web/app/views/wizard/step1_view.js
index eb107b9edd..5141b87e12 100644
--- a/ambari-web/app/views/wizard/step1_view.js
+++ b/ambari-web/app/views/wizard/step1_view.js
@@ -324,7 +324,7 @@ App.WizardStep1View = Em.View.extend({
         });
       }
     }, this);
-    if (changedRepo) {
+    if (changedRepo && !App.supports.disableCredentialsAutocompleteForRepoUrls) {
       try {
         var urlObject = new URL(changedRepo.get('baseUrl'));
       } catch (e) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ambari.apache.org
For additional commands, e-mail: commits-help@ambari.apache.org