You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/09/21 11:13:04 UTC

[GitHub] [hive] zabetak commented on a diff in pull request #3609: HIVE-26549: Add auth config for WebHCat server

zabetak commented on code in PR #3609:
URL: https://github.com/apache/hive/pull/3609#discussion_r976373915


##########
hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/Main.java:
##########
@@ -306,18 +308,30 @@ private Connector createChannelConnector(Server server) {
   public FilterHolder makeAuthFilter() throws IOException {
     FilterHolder authFilter = new FilterHolder(AuthFilter.class);
     UserNameHandler.allowAnonymous(authFilter);
+  
+    // compatible with Hadoop 3.3.x.

Review Comment:
   Can you elaborate a bit more what compatible means.
   
   If I understand well the changes are required after upgrading to hadoop 3.3.x onwards otherwise the Authentication filter will not work but what happens with versions before 3.3.x.  I guess that the new code will not work if an earlier version of hadoop is used.



##########
hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/Main.java:
##########
@@ -306,18 +308,30 @@ private Connector createChannelConnector(Server server) {
   public FilterHolder makeAuthFilter() throws IOException {
     FilterHolder authFilter = new FilterHolder(AuthFilter.class);
     UserNameHandler.allowAnonymous(authFilter);
+  
+    // compatible with Hadoop 3.3.x.
+    // https://issues.apache.org/jira/browse/HIVE-24083

Review Comment:
   Please remove the link to the JIRA. We will pre-pend it to the commit message so developers will be able to find it.



##########
hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/Main.java:
##########
@@ -306,18 +308,30 @@ private Connector createChannelConnector(Server server) {
   public FilterHolder makeAuthFilter() throws IOException {
     FilterHolder authFilter = new FilterHolder(AuthFilter.class);
     UserNameHandler.allowAnonymous(authFilter);
+  
+    // compatible with Hadoop 3.3.x.
+    // https://issues.apache.org/jira/browse/HIVE-24083
+    String confPrefix = "dfs.web.authentication";
+    String prefix = confPrefix + ".";
+    authFilter.setInitParameter(AuthenticationFilter.CONFIG_PREFIX, confPrefix);
+    authFilter.setInitParameter(prefix + AuthenticationFilter.COOKIE_PATH, "/");
+    
     if (UserGroupInformation.isSecurityEnabled()) {
+      authFilter.setInitParameter(prefix + AuthenticationFilter.AUTH_TYPE, KerberosAuthenticationHandler.TYPE);
+  
       //http://hadoop.apache.org/docs/r1.1.1/api/org/apache/hadoop/security/authentication/server/AuthenticationFilter.html

Review Comment:
   Please remove the links towards Hadoop source code; they are obsolete and do not really provide any useful information right now.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org