You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by vs...@apache.org on 2018/07/09 07:14:22 UTC

[ambari] branch AMBARI-24152-branch-2.7 created (now 69aaaeb)

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

vsairam pushed a change to branch AMBARI-24152-branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git.


      at 69aaaeb  AMBARI-24152 Ambari Workflow Manager (wfmanager) sends plaintext content over API. JSON is expected. (#1659)

This branch includes the following new commits:

     new 69aaaeb  AMBARI-24152 Ambari Workflow Manager (wfmanager) sends plaintext content over API. JSON is expected. (#1659)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[ambari] 01/01: AMBARI-24152 Ambari Workflow Manager (wfmanager) sends plaintext content over API. JSON is expected. (#1659)

Posted by vs...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 69aaaeb916327bb6dfb5f38cc9cbf99e31124a57
Author: Venkata Sairam Lanka <ve...@gmail.com>
AuthorDate: Mon Jul 9 12:21:17 2018 +0530

    AMBARI-24152 Ambari Workflow Manager (wfmanager) sends plaintext content over API. JSON is expected. (#1659)
---
 .../org/apache/oozie/ambari/view/OozieProxyImpersonator.java | 12 +++++++++++-
 .../src/main/resources/ui/app/services/user-info.js          |  5 +++--
 contrib/views/wfmanager/src/main/resources/ui/package.json   |  2 +-
 contrib/views/wfmanager/src/main/resources/ui/yarn.lock      |  8 ++++----
 4 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/OozieProxyImpersonator.java b/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/OozieProxyImpersonator.java
index 8d2b5a5..15a1042 100644
--- a/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/OozieProxyImpersonator.java
+++ b/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/OozieProxyImpersonator.java
@@ -58,6 +58,11 @@ import org.slf4j.LoggerFactory;
 
 import com.google.inject.Singleton;
 
+import org.json.simple.JSONObject;
+
+
+
+
 /**
  * This is a class used to bridge the communication between the and the Oozie
  * API executing inside ambari.
@@ -154,7 +159,12 @@ public class OozieProxyImpersonator {
   @GET
   @Path("/getCurrentUserName")
   public Response getCurrentUserName() {
-    return Response.ok(viewContext.getUsername()).build();
+
+    JSONObject obj = new JSONObject();
+
+    obj.put("username", viewContext.getUsername());
+
+    return Response.ok(obj).build();
   }
 
   @GET
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/services/user-info.js b/contrib/views/wfmanager/src/main/resources/ui/app/services/user-info.js
index 701f953..3c1c5c5 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/services/user-info.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/services/user-info.js
@@ -37,8 +37,9 @@ export default Ember.Service.extend({
           xhr.setRequestHeader("X-Requested-By", "Ambari");
         }
       }).done(function(data){
-        self.set("userName", data);
-        deferred.resolve(data);
+        let uname = JSON.parse(data).username;
+        self.set("userName", JSON.parse(data).username);
+        deferred.resolve(uname);
       }).fail(function(data){
         self.set("userName", "");
         deferred.reject(data);
diff --git a/contrib/views/wfmanager/src/main/resources/ui/package.json b/contrib/views/wfmanager/src/main/resources/ui/package.json
index 69f43c8..18b4ae0 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/package.json
+++ b/contrib/views/wfmanager/src/main/resources/ui/package.json
@@ -19,7 +19,7 @@
   "author": "",
   "license": "MIT",
   "devDependencies": {
-    "bower": "^1.7.7",
+    "bower": "1.8.4",
     "broccoli-asset-rev": "^2.2.0",
     "babel-plugin-transform-es2015-block-scoping": "^6.24.1",
     "ember-ajax": "0.7.1",
diff --git a/contrib/views/wfmanager/src/main/resources/ui/yarn.lock b/contrib/views/wfmanager/src/main/resources/ui/yarn.lock
index f3602c9..e10f44b 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/yarn.lock
+++ b/contrib/views/wfmanager/src/main/resources/ui/yarn.lock
@@ -588,7 +588,7 @@ babel-plugin-transform-es2015-block-scoped-functions@^6.22.0:
   dependencies:
     babel-runtime "^6.22.0"
 
-babel-plugin-transform-es2015-block-scoping@^6.23.0:
+babel-plugin-transform-es2015-block-scoping@^6.23.0, babel-plugin-transform-es2015-block-scoping@^6.24.1:
   version "6.24.1"
   resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.24.1.tgz#76c295dc3a4741b1665adfd3167215dcff32a576"
   dependencies:
@@ -989,9 +989,9 @@ bower-endpoint-parser@0.2.2:
   version "0.2.2"
   resolved "https://registry.yarnpkg.com/bower-endpoint-parser/-/bower-endpoint-parser-0.2.2.tgz#00b565adbfab6f2d35addde977e97962acbcb3f6"
 
-bower@^1.3.12, bower@^1.7.7:
-  version "1.8.0"
-  resolved "https://registry.yarnpkg.com/bower/-/bower-1.8.0.tgz#55dbebef0ad9155382d9e9d3e497c1372345b44a"
+bower@1.8.4, bower@^1.3.12:
+  version "1.8.4"
+  resolved "https://registry.yarnpkg.com/bower/-/bower-1.8.4.tgz#e7876a076deb8137f7d06525dc5e8c66db82f28a"
 
 brace-expansion@^1.0.0:
   version "1.1.7"