knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From su...@apache.org
Subject knox git commit: KNOX-594 Stopping HS2 'SET-COOKIE' header to go back and managing 'hive.server2.auth' cookie
Date Thu, 28 Jan 2016 16:03:07 GMT
Repository: knox
Updated Branches:
  refs/heads/master 933e848a6 -> db601e350


KNOX-594 Stopping HS2 'SET-COOKIE' header to go back and managing 'hive.server2.auth' cookie


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

Branch: refs/heads/master
Commit: db601e350d014bef58b16f7f631c3056d1f00dd3
Parents: 933e848
Author: Sumit Gupta <sumit@apache.org>
Authored: Thu Jan 28 11:02:09 2016 -0500
Committer: Sumit Gupta <sumit@apache.org>
Committed: Thu Jan 28 11:02:09 2016 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/hadoop/gateway/hive/HiveDispatch.java | 3 ---
 .../org/apache/hadoop/gateway/dispatch/DefaultDispatch.java    | 6 +++---
 .../apache/hadoop/gateway/dispatch/HadoopAuthCookieStore.java  | 2 +-
 3 files changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/db601e35/gateway-service-hive/src/main/java/org/apache/hadoop/gateway/hive/HiveDispatch.java
----------------------------------------------------------------------
diff --git a/gateway-service-hive/src/main/java/org/apache/hadoop/gateway/hive/HiveDispatch.java
b/gateway-service-hive/src/main/java/org/apache/hadoop/gateway/hive/HiveDispatch.java
index bdfb1f8..4376a98 100644
--- a/gateway-service-hive/src/main/java/org/apache/hadoop/gateway/hive/HiveDispatch.java
+++ b/gateway-service-hive/src/main/java/org/apache/hadoop/gateway/hive/HiveDispatch.java
@@ -20,10 +20,7 @@ package org.apache.hadoop.gateway.hive;
 import org.apache.hadoop.gateway.config.Configure;
 import org.apache.hadoop.gateway.config.Default;
 import org.apache.hadoop.gateway.dispatch.DefaultDispatch;
-import org.apache.hadoop.gateway.security.SubjectUtils;
-import org.apache.http.auth.UsernamePasswordCredentials;
 import org.apache.http.client.methods.HttpUriRequest;
-import org.apache.http.impl.auth.BasicScheme;
 
 /**
  * This specialized dispatch provides Hive specific features to the

http://git-wip-us.apache.org/repos/asf/knox/blob/db601e35/gateway-spi/src/main/java/org/apache/hadoop/gateway/dispatch/DefaultDispatch.java
----------------------------------------------------------------------
diff --git a/gateway-spi/src/main/java/org/apache/hadoop/gateway/dispatch/DefaultDispatch.java
b/gateway-spi/src/main/java/org/apache/hadoop/gateway/dispatch/DefaultDispatch.java
index ea9b992..85ecb08 100644
--- a/gateway-spi/src/main/java/org/apache/hadoop/gateway/dispatch/DefaultDispatch.java
+++ b/gateway-spi/src/main/java/org/apache/hadoop/gateway/dispatch/DefaultDispatch.java
@@ -56,8 +56,8 @@ import java.util.Set;
  */
 public class DefaultDispatch extends AbstractGatewayDispatch {
 
-  protected static final String SET_COOKIE = "Set-Cookie";
-  protected static final String WWW_AUTHENTICATE = "WWW-Authenticate";
+  protected static final String SET_COOKIE = "SET-COOKIE";
+  protected static final String WWW_AUTHENTICATE = "WWW-AUTHENTICATE";
 
   protected static SpiGatewayMessages LOG = MessagesFactory.get(SpiGatewayMessages.class);
   protected static SpiGatewayResources RES = ResourcesFactory.get(SpiGatewayResources.class);
@@ -142,7 +142,7 @@ public class DefaultDispatch extends AbstractGatewayDispatch {
     }
     for ( Header header : headers ) {
       String name = header.getName();
-      if (hasExcludeHeaders && excludeHeaders.contains(name)) {
+      if (hasExcludeHeaders && excludeHeaders.contains(name.toUpperCase())) {
         continue;
       }
       String value = header.getValue();

http://git-wip-us.apache.org/repos/asf/knox/blob/db601e35/gateway-spi/src/main/java/org/apache/hadoop/gateway/dispatch/HadoopAuthCookieStore.java
----------------------------------------------------------------------
diff --git a/gateway-spi/src/main/java/org/apache/hadoop/gateway/dispatch/HadoopAuthCookieStore.java
b/gateway-spi/src/main/java/org/apache/hadoop/gateway/dispatch/HadoopAuthCookieStore.java
index 17406a3..612c1de 100644
--- a/gateway-spi/src/main/java/org/apache/hadoop/gateway/dispatch/HadoopAuthCookieStore.java
+++ b/gateway-spi/src/main/java/org/apache/hadoop/gateway/dispatch/HadoopAuthCookieStore.java
@@ -24,7 +24,7 @@ public class HadoopAuthCookieStore extends BasicCookieStore {
 
   @Override
   public void addCookie(Cookie cookie) {
-    if (cookie.getName().equals("hadoop.auth")) {
+    if (cookie.getName().equals("hadoop.auth") || cookie.getName().equals("hive.server2.auth"))
{
       super.addCookie(cookie);
     }
   }


Mime
View raw message