ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srima...@apache.org
Subject ambari git commit: AMBARI-12054. Include ssl.server.client.auth in Slider configuration to appmaster section (srimanth)
Date Tue, 23 Jun 2015 17:06:40 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 62d1373de -> 128ae493b


AMBARI-12054. Include ssl.server.client.auth in Slider configuration to appmaster section
(srimanth)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/128ae493
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/128ae493
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/128ae493

Branch: refs/heads/branch-2.1
Commit: 128ae493bd463b4fdf2a4c0018ccdb9694f514a0
Parents: 62d1373
Author: Srimanth Gunturi <sgunturi@hortonworks.com>
Authored: Mon Jun 22 15:05:24 2015 -0700
Committer: Srimanth Gunturi <sgunturi@hortonworks.com>
Committed: Tue Jun 23 10:06:05 2015 -0700

----------------------------------------------------------------------
 .../view/slider/SliderAppsViewControllerImpl.java  | 17 ++++++++++++++---
 .../createAppWizard/step1_controller.js            |  1 +
 .../createAppWizard/step4_controller.js            |  1 +
 .../ui/app/templates/createAppWizard/step1.hbs     | 12 ++++++++++++
 .../ui/app/templates/createAppWizard/step4.hbs     |  1 +
 .../src/main/resources/ui/app/translations.js      |  6 ++++--
 .../createAppWizard/step1_controller_test.js       |  2 +-
 .../createAppWizard/step4_controller_test.js       |  2 ++
 8 files changed, 36 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/128ae493/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
index 5a8259f..0975ea8 100644
--- a/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
+++ b/contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java
@@ -1186,6 +1186,7 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController
{
       final String appName = json.get("name").getAsString();
       final String queueName = json.has("queue") ? json.get("queue").getAsString() : null;
       final boolean securityEnabled = Boolean.valueOf(getHadoopConfigs().get("security_enabled"));
+      final boolean twoWaySSlEnabled = json.has("twoWaySSLEnabled") ? Boolean.valueOf(json.get("twoWaySSLEnabled").getAsString())
: false;
       JsonObject configs = json.get("typeConfigs").getAsJsonObject();
       JsonObject resourcesObj = json.get("resources").getAsJsonObject();
       JsonArray componentsArray = resourcesObj.get("components").getAsJsonArray();
@@ -1217,7 +1218,7 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController
{
       appCreateFolder.mkdirs();
       File appConfigJsonFile = new File(appCreateFolder, "appConfig.json");
       File resourcesJsonFile = new File(appCreateFolder, "resources.json");
-      saveAppConfigs(configs, componentsArray, appName, sliderAppType.getTypeName(), securityEnabled,
appConfigJsonFile);
+      saveAppConfigs(configs, componentsArray, appName, sliderAppType.getTypeName(), securityEnabled,
twoWaySSlEnabled, appConfigJsonFile);
       saveAppResources(resourcesObj, resourcesJsonFile);
 
       final ActionCreateArgs createArgs = new ActionCreateArgs();
@@ -1375,7 +1376,7 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController
{
   }
 
   private void saveAppConfigs(JsonObject configs, JsonArray componentsArray,
-      String appName, String appType, boolean securityEnabled, File appConfigJsonFile) throws
IOException {
+      String appName, String appType, boolean securityEnabled, boolean twoWaySSlEnabled,
File appConfigJsonFile) throws IOException {
     JsonObject appConfigs = new JsonObject();
     appConfigs.addProperty("schema", "http://example.org/specification/v2.0.0");
     appConfigs.add("metadata", new JsonObject());
@@ -1402,7 +1403,17 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController
{
       appMasterComponent.add("slider.am.login.keytab.name", new JsonPrimitive(fileName));
       appMasterComponent.add("slider.hdfs.keytab.dir", new JsonPrimitive(".slider/keytabs/"
+ appName));
       componentsObj.add("slider-appmaster", appMasterComponent);
-    }
+   }
+   if (twoWaySSlEnabled) {
+     JsonObject appMasterComponent;
+     if (componentsObj.has("slider-appmaster")) {
+       appMasterComponent = componentsObj.get("slider-appmaster").getAsJsonObject();
+     } else {
+       appMasterComponent = new JsonObject();
+       componentsObj.add("slider-appmaster", appMasterComponent);
+     }
+     appMasterComponent.add("ssl.server.client.auth", new JsonPrimitive("true"));
+   }
    appConfigs.add("components", componentsObj);
     String jsonString = new GsonBuilder().setPrettyPrinting().create().toJson(appConfigs);
     FileOutputStream fos = null;

http://git-wip-us.apache.org/repos/asf/ambari/blob/128ae493/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js
b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js
index 2110828..bcbb6cb 100644
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js
+++ b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js
@@ -106,6 +106,7 @@ App.CreateAppWizardStep1Controller = Ember.Controller.extend(App.AjaxErrorHandle
       properties = Em.A(['name', 'includeFilePatterns', 'excludeFilePatterns', 'frequency',
'queueName', 'specialLabel', 'selectedYarnLabel']),
       newApp = Ember.Object.create({
         appType: null,
+        twoWaySSLEnabled: false,
         configs: {}
       });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/128ae493/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step4_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step4_controller.js
b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step4_controller.js
index 1089fe9..79dc4ba 100644
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step4_controller.js
+++ b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step4_controller.js
@@ -128,6 +128,7 @@ App.CreateAppWizardStep4Controller = Ember.ObjectController.extend(App.AjaxError
       typeName: app.get('appType.index'),
       typeVersion: app.get('appType.version'),
       name: app.get('name'),
+      twoWaySSLEnabled: app.get('twoWaySSLEnabled') + "",
       resources: this.get('resourcesFormatted'),
       typeConfigs: app.get('configs')
     };

http://git-wip-us.apache.org/repos/asf/ambari/blob/128ae493/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard/step1.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard/step1.hbs
b/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard/step1.hbs
index d5cdb3c..fc46c69 100644
--- a/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard/step1.hbs
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard/step1.hbs
@@ -81,6 +81,18 @@
         </div>
       </div>
     {{/if}}
+    <div class="form-group row">
+      <div class="col-xs-3">
+        <label class=" control-label">{{t wizard.step1.enable2wayssl}}</label>
+      </div>
+      <div class="col-xs-7">
+        {{view
+          Em.Checkbox
+          class="form-control type-select"
+          checkedBinding="controller.newApp.twoWaySSLEnabled"
+        }}
+      </div>
+    </div>
     <!-- Available Applications end -->
     <!-- Scheduler Options -->
     <hr />

http://git-wip-us.apache.org/repos/asf/ambari/blob/128ae493/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard/step4.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard/step4.hbs
b/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard/step4.hbs
index 9174f9c..50e974b 100644
--- a/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard/step4.hbs
+++ b/contrib/views/slider/src/main/resources/ui/app/templates/createAppWizard/step4.hbs
@@ -21,6 +21,7 @@
 <ul>
   <li>{{t wizard.step4.appName}}: {{controller.newApp.name}}</li>
   <li>{{t wizard.step4.appType}}: {{controller.newApp.appType.displayName}}</li>
+  <li>{{t wizard.step4.2waysslEnabled}}: {{controller.newApp.twoWaySSLEnabled}}</li>
 </ul>
 <h5>{{t common.components}}</h5>
 <ul>

http://git-wip-us.apache.org/repos/asf/ambari/blob/128ae493/contrib/views/slider/src/main/resources/ui/app/translations.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/translations.js b/contrib/views/slider/src/main/resources/ui/app/translations.js
index 652ef10..f26fee2 100644
--- a/contrib/views/slider/src/main/resources/ui/app/translations.js
+++ b/contrib/views/slider/src/main/resources/ui/app/translations.js
@@ -65,8 +65,8 @@ Em.I18n.translations = {
     'placeholder': {
       'optional': '(optional)',
       'step1.name': 'Enter Name (required)',
-      'include.file.patterns': '*.log',
-      'exclude.file.patterns': '*.zip',
+      'include.file.patterns': '.*log',
+      'exclude.file.patterns': '.*zip',
       'frequency': '3600'
     }
   },
@@ -144,6 +144,7 @@ Em.I18n.translations = {
   'wizard.step1.validateAppNameError': 'Application with name \'{0}\' already exists',
   'wizard.step1.noAppTypesError': 'No Slider Application packages have been installed on
this server. Please contact your Ambari server administrator to install Slider Application
packages into /var/lib/ambari-server/resources/apps/ folder and restart Ambari server.',
   'wizard.step1.frequencyError': 'Frequency value should be numeric',
+  'wizard.step1.enable2wayssl': 'Enable Two-Way SSL',
   'wizard.step2.name': 'Allocate Resources',
   'wizard.step2.header': ' application requires resources to be allocated on the cluster.
Provide resource allocation requests for each component of the application below.',
   'wizard.step2.table.instances': 'Instances',
@@ -160,6 +161,7 @@ Em.I18n.translations = {
   'wizard.step4.name': 'Deploy',
   'wizard.step4.appName': 'App Name',
   'wizard.step4.appType': 'App Type',
+  'wizard.step4.2waysslEnabled': 'Two-Way SSL Enabled',
 
   'ajax.errorMessage': 'Error message',
   'ajax.apiInfo': 'received on {0} method for API: {1}',

http://git-wip-us.apache.org/repos/asf/ambari/blob/128ae493/contrib/views/slider/src/main/resources/ui/test/unit/controllers/createAppWizard/step1_controller_test.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/test/unit/controllers/createAppWizard/step1_controller_test.js
b/contrib/views/slider/src/main/resources/ui/test/unit/controllers/createAppWizard/step1_controller_test.js
index 51bbe23..57cf7a6 100644
--- a/contrib/views/slider/src/main/resources/ui/test/unit/controllers/createAppWizard/step1_controller_test.js
+++ b/contrib/views/slider/src/main/resources/ui/test/unit/controllers/createAppWizard/step1_controller_test.js
@@ -125,7 +125,7 @@ test('initializeNewApp', function () {
     return controller.get('newApp.' + item);
   });
 
-  propEqual(values.uniq(), [''], 'should set properties values to empty strings as default');
+  propEqual(values.uniq(), [false, ''], 'should set properties values to empty strings as
default');
 
   Em.run(function () {
     controller.set('controllers.createAppWizard.newApp', app);

http://git-wip-us.apache.org/repos/asf/ambari/blob/128ae493/contrib/views/slider/src/main/resources/ui/test/unit/controllers/createAppWizard/step4_controller_test.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/test/unit/controllers/createAppWizard/step4_controller_test.js
b/contrib/views/slider/src/main/resources/ui/test/unit/controllers/createAppWizard/step4_controller_test.js
index fe44f47..acaecaa 100644
--- a/contrib/views/slider/src/main/resources/ui/test/unit/controllers/createAppWizard/step4_controller_test.js
+++ b/contrib/views/slider/src/main/resources/ui/test/unit/controllers/createAppWizard/step4_controller_test.js
@@ -363,6 +363,7 @@ test('sendAppDataToServer', function () {
           version: '1'
         },
         name: 'name',
+        twoWaySSLEnabled: false,
         configs: {
           key: 'value'
         }
@@ -405,6 +406,7 @@ test('sendAppDataToServer', function () {
       typeName: 'ACCUMULO',
       typeVersion: '1',
       name: 'name',
+      twoWaySSLEnabled: 'false',
       resources: {
         components: []
       },


Mime
View raw message