knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lmc...@apache.org
Subject knox git commit: KNOX-636 - IdentityAsserterHttpServletRequestWrapper must override getUserPrincipal
Date Wed, 02 Dec 2015 18:16:56 GMT
Repository: knox
Updated Branches:
  refs/heads/master 1671f684f -> 18a2eecd7


KNOX-636 - IdentityAsserterHttpServletRequestWrapper must override getUserPrincipal

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

Branch: refs/heads/master
Commit: 18a2eecd73d82c0e270cb0706a643cddaea4dbb6
Parents: 1671f68
Author: Larry McCay <lmccay@hortonworks.com>
Authored: Wed Dec 2 13:10:10 2015 -0500
Committer: Larry McCay <lmccay@hortonworks.com>
Committed: Wed Dec 2 13:10:10 2015 -0500

----------------------------------------------------------------------
 .../filter/IdentityAsserterHttpServletRequestWrapper.java   | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/18a2eecd/gateway-provider-identity-assertion-common/src/main/java/org/apache/hadoop/gateway/identityasserter/common/filter/IdentityAsserterHttpServletRequestWrapper.java
----------------------------------------------------------------------
diff --git a/gateway-provider-identity-assertion-common/src/main/java/org/apache/hadoop/gateway/identityasserter/common/filter/IdentityAsserterHttpServletRequestWrapper.java
b/gateway-provider-identity-assertion-common/src/main/java/org/apache/hadoop/gateway/identityasserter/common/filter/IdentityAsserterHttpServletRequestWrapper.java
index d32cc58..257cadf 100644
--- a/gateway-provider-identity-assertion-common/src/main/java/org/apache/hadoop/gateway/identityasserter/common/filter/IdentityAsserterHttpServletRequestWrapper.java
+++ b/gateway-provider-identity-assertion-common/src/main/java/org/apache/hadoop/gateway/identityasserter/common/filter/IdentityAsserterHttpServletRequestWrapper.java
@@ -21,6 +21,7 @@ import org.apache.commons.io.IOUtils;
 import org.apache.hadoop.gateway.SpiGatewayMessages;
 import org.apache.hadoop.gateway.config.GatewayConfig;
 import org.apache.hadoop.gateway.i18n.messages.MessagesFactory;
+import org.apache.hadoop.gateway.security.PrimaryPrincipal;
 import org.apache.hadoop.gateway.util.HttpUtils;
 
 import javax.servlet.ServletInputStream;
@@ -32,6 +33,7 @@ import java.io.InputStream;
 import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
 import java.nio.charset.Charset;
+import java.security.Principal;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -41,7 +43,7 @@ import java.util.Map;
 
 public class IdentityAsserterHttpServletRequestWrapper extends HttpServletRequestWrapper
{
 
-  private static SpiGatewayMessages log = MessagesFactory.get( SpiGatewayMessages.class );
+private static SpiGatewayMessages log = MessagesFactory.get( SpiGatewayMessages.class );
 
   private static final String PRINCIPAL_PARAM = "user.name";
   private static final String DOAS_PRINCIPAL_PARAM = "doAs";
@@ -54,6 +56,11 @@ public class IdentityAsserterHttpServletRequestWrapper extends HttpServletReques
   }
 
   @Override
+  public Principal getUserPrincipal() {
+    return new PrimaryPrincipal(username);
+  }
+
+  @Override
   public String getParameter(String name) {
     if (name.equals(PRINCIPAL_PARAM)) {
       return username;


Mime
View raw message