Updated Branches: refs/heads/branch-1.2.5 d128903f7 -> 58034089a
AMBARI-2663. Security wizard: oozie principal should be mapped to oozie user name via hadoop.security.auth_to_local property. (jaimin via yusaku) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/58034089 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/58034089 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/58034089 Branch: refs/heads/branch-1.2.5 Commit: 58034089a541c2af50fad0c53c63363079ddb776 Parents: d128903 Author: Yusaku Sako <[email protected]> Authored: Wed Jul 17 16:21:23 2013 -0700 Committer: Yusaku Sako <[email protected]> Committed: Wed Jul 17 16:21:26 2013 -0700 ---------------------------------------------------------------------- .../app/controllers/main/admin/security/add/step4.js | 15 +++++++++------ ambari-web/app/data/secure_mapping.js | 10 ++++------ 2 files changed, 13 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/58034089/ambari-web/app/controllers/main/admin/security/add/step4.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/security/add/step4.js b/ambari-web/app/controllers/main/admin/security/add/step4.js index b620e1c..5b47d4c 100644 --- a/ambari-web/app/controllers/main/admin/security/add/step4.js +++ b/ambari-web/app/controllers/main/admin/security/add/step4.js @@ -237,8 +237,8 @@ App.MainAdminSecurityAddStep4Controller = Em.Controller.extend({ var configs = this.get('secureMapping').filterProperty('foreignKey', null); configs.forEach(function (_config) { var value = _config.value; - if (_config.hasOwnProperty('dependedServiceName') && _config.hasOwnProperty('replace')) { - value = this.checkServiceForConfigValue(value, _config.dependedServiceName, _config.replace); + if (_config.hasOwnProperty('dependedServiceName')) { + value = this.checkServiceForConfigValue(value, _config.dependedServiceName); } value = this.getGlobConfigValue(_config.templateName, value, _config.name); uiConfig.pushObject({ @@ -264,10 +264,13 @@ App.MainAdminSecurityAddStep4Controller = Em.Controller.extend({ }, - checkServiceForConfigValue: function (value, serviceName, replace) { - if (!App.Service.find().mapProperty('serviceName').contains(serviceName)) { - value = value.replace(replace, ''); - } + checkServiceForConfigValue: function (value, serviceNames) { + serviceNames.forEach(function(_serviceName){ + if (!App.Service.find().mapProperty('serviceName').contains(_serviceName.name)) { + value = value.replace(_serviceName.replace, ''); + } + },this); + return value; }, http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/58034089/ambari-web/app/data/secure_mapping.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/data/secure_mapping.js b/ambari-web/app/data/secure_mapping.js index 66091eb..3867cf7 100644 --- a/ambari-web/app/data/secure_mapping.js +++ b/ambari-web/app/data/secure_mapping.js @@ -36,13 +36,12 @@ module.exports = [ { "name": "hadoop.security.auth_to_local", - "templateName": ["jobtracker_primary_name", "kerberos_domain", "mapred_user", "tasktracker_primary_name", "namenode_primary_name", "hdfs_user", "datanode_primary_name", "hbase_master_primary_name", "hbase_user","hbase_regionserver_primary_name"], + "templateName": ["jobtracker_primary_name", "kerberos_domain", "mapred_user", "tasktracker_primary_name", "namenode_primary_name", "hdfs_user", "datanode_primary_name", "hbase_master_primary_name", "hbase_user","hbase_regionserver_primary_name","oozie_primary_name","oozie_user"], "foreignKey": null, - "value": "RULE:[2:$1@$0](<templateName[0]>@.*<templateName[1]>)s/.*/<templateName[2]>/\nRULE:[2:$1@$0](<templateName[3]>@.*<templateName[1]>)s/.*/<templateName[2]>/\nRULE:[2:$1@$0](<templateName[4]>@.*<templateName[1]>)s/.*/<templateName[5]>/\nRULE:[2:$1@$0](<templateName[6]>@.*<templateName[1]>)s/.*/<templateName[5]>/\nRULE:[2:$1@$0](<templateName[7]>@.*<templateName[1]>)s/.*/<templateName[8]>/\nRULE:[2:$1@$0](<templateName[9]>@.*<templateName[1]>)s/.*/<templateName[8]>/\nDEFAULT", + "value": "RULE:[2:$1@$0](<templateName[0]>@.*<templateName[1]>)s/.*/<templateName[2]>/\nRULE:[2:$1@$0](<templateName[3]>@.*<templateName[1]>)s/.*/<templateName[2]>/\nRULE:[2:$1@$0](<templateName[4]>@.*<templateName[1]>)s/.*/<templateName[5]>/\nRULE:[2:$1@$0](<templateName[6]>@.*<templateName[1]>)s/.*/<templateName[5]>/\nRULE:[2:$1@$0](<templateName[7]>@.*<templateName[1]>)s/.*/<templateName[8]>/\nRULE:[2:$1@$0](<templateName[9]>@.*<templateName[1]>)s/.*/<templateName[8]>/\nRULE:[2:$1@$0](<templateName[10]>@.*<templateName[1]>)s/.*/<templateName[11]>/\nDEFAULT", "filename": "core-site.xml", "serviceName": "HDFS", - "dependedServiceName": "HBASE", - "replace": "\nRULE:[2:$1@$0](<templateName[7]>@.*<templateName[1]>)s/.*/<templateName[8]>/\nRULE:[2:$1@$0](<templateName[9]>@.*<templateName[1]>)s/.*/<templateName[8]>/" + "dependedServiceName": [{name: "HBASE", replace: "\nRULE:[2:$1@$0](<templateName[7]>@.*<templateName[1]>)s/.*/<templateName[8]>/\nRULE:[2:$1@$0](<templateName[9]>@.*<templateName[1]>)s/.*/<templateName[8]>/"},{name: "OOZIE",replace: "\nRULE:[2:$1@$0](<templateName[10]>@.*<templateName[1]>)s/.*/<templateName[11]>/"}] }, { "name": "dfs.namenode.kerberos.principal", @@ -346,8 +345,7 @@ module.exports = [ "value": "RULE:[2:$1@$0](<templateName[0]>@.*<templateName[1]>)s/.*/<templateName[2]>/\nRULE:[2:$1@$0](<templateName[3]>@.*<templateName[1]>)s/.*/<templateName[2]>/\nRULE:[2:$1@$0](<templateName[4]>@.*<templateName[1]>)s/.*/<templateName[5]>/\nRULE:[2:$1@$0](<templateName[6]>@.*<templateName[1]>)s/.*/<templateName[5]>/\nRULE:[2:$1@$0](<templateName[7]>@.*<templateName[1]>)s/.*/<templateName[8]>/\nRULE:[2:$1@$0](<templateName[9]>@.*<templateName[1]>)s/.*/<templateName[8]>/\nDEFAULT", "filename": "oozie-site.xml", "serviceName": "OOZIE", - "dependedServiceName": "HBASE", - "replace": "\nRULE:[2:$1@$0](<templateName[7]>@.*<templateName[1]>)s/.*/<templateName[8]>/\nRULE:[2:$1@$0](<templateName[9]>@.*<templateName[1]>)s/.*/<templateName[8]>/" + "dependedServiceName": [{name: "HBASE", replace: "\nRULE:[2:$1@$0](<templateName[7]>@.*<templateName[1]>)s/.*/<templateName[8]>/\nRULE:[2:$1@$0](<templateName[9]>@.*<templateName[1]>)s/.*/<templateName[8]>/"}] }, { "name": "templeton.kerberos.principal",
