sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [14/14] sqoop git commit: SQOOP-1775: Sqoop2: Migrate to URL parameter user.name instead of using header
Date Sat, 22 Nov 2014 01:43:59 GMT
SQOOP-1775: Sqoop2: Migrate to URL parameter user.name instead of using header

(Abraham Elmahrek via Jarek Jarcec Cecho)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/55b20c41
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/55b20c41
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/55b20c41

Branch: refs/heads/cdh5-1.99.4
Commit: 55b20c41c5ab64b9a47066a0921c8fe0caa5e30d
Parents: b9786af
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Fri Nov 21 17:37:27 2014 -0800
Committer: Abraham Elmahrek <abraham@elmahrek.com>
Committed: Fri Nov 21 17:43:13 2014 -0800

----------------------------------------------------------------------
 .../java/org/apache/sqoop/client/request/ResourceRequest.java    | 2 --
 .../java/org/apache/sqoop/common/SqoopProtocolConstants.java     | 2 --
 server/src/main/java/org/apache/sqoop/server/RequestContext.java | 4 ++--
 3 files changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/55b20c41/client/src/main/java/org/apache/sqoop/client/request/ResourceRequest.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/sqoop/client/request/ResourceRequest.java b/client/src/main/java/org/apache/sqoop/client/request/ResourceRequest.java
index db16107..3c4a4d2 100644
--- a/client/src/main/java/org/apache/sqoop/client/request/ResourceRequest.java
+++ b/client/src/main/java/org/apache/sqoop/client/request/ResourceRequest.java
@@ -56,8 +56,6 @@ public class ResourceRequest {
       HttpURLConnection conn = new AuthenticatedURL().openConnection(url, token);
 
       conn.setRequestMethod(method);
-//      Provide name of user executing request
-      conn.setRequestProperty(SqoopProtocolConstants.HEADER_SQOOP_USERNAME, System.getProperty("user.name"));
 //      Sqoop is using JSON for data transfers
       conn.setRequestProperty("Accept", MediaType.APPLICATION_JSON);
 //      Transfer client locale to return client specific data

http://git-wip-us.apache.org/repos/asf/sqoop/blob/55b20c41/common/src/main/java/org/apache/sqoop/common/SqoopProtocolConstants.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/sqoop/common/SqoopProtocolConstants.java b/common/src/main/java/org/apache/sqoop/common/SqoopProtocolConstants.java
index d08c855..8f4f709 100644
--- a/common/src/main/java/org/apache/sqoop/common/SqoopProtocolConstants.java
+++ b/common/src/main/java/org/apache/sqoop/common/SqoopProtocolConstants.java
@@ -18,8 +18,6 @@
 package org.apache.sqoop.common;
 
 public final class SqoopProtocolConstants {
-  public static final String HEADER_SQOOP_USERNAME = "sqoop-user-name";
-
   public static final String HEADER_SQOOP_ERROR_CODE = "sqoop-error-code";
 
   public static final String HEADER_SQOOP_ERROR_MESSAGE = "sqoop-error-message";

http://git-wip-us.apache.org/repos/asf/sqoop/blob/55b20c41/server/src/main/java/org/apache/sqoop/server/RequestContext.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/sqoop/server/RequestContext.java b/server/src/main/java/org/apache/sqoop/server/RequestContext.java
index 54e9cca..d0963f5 100644
--- a/server/src/main/java/org/apache/sqoop/server/RequestContext.java
+++ b/server/src/main/java/org/apache/sqoop/server/RequestContext.java
@@ -17,8 +17,8 @@
  */
 package org.apache.sqoop.server;
 
+import org.apache.hadoop.security.authentication.client.PseudoAuthenticator;
 import org.apache.sqoop.common.SqoopException;
-import org.apache.sqoop.common.SqoopProtocolConstants;
 import org.apache.sqoop.server.common.ServerError;
 
 import javax.servlet.http.HttpServletRequest;
@@ -119,6 +119,6 @@ public class RequestContext {
    * @return Name of user sending the request
    */
   public String getUserName() {
-	return request.getHeader(SqoopProtocolConstants.HEADER_SQOOP_USERNAME);
+    return request.getParameter(PseudoAuthenticator.USER_NAME);
   }
 }


Mime
View raw message