Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 3349ae263 -> 39ab0a6f2


SQOOP-1774: Sqoop2: Allow anonymous authentication

(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/39ab0a6f
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/39ab0a6f
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/39ab0a6f

Branch: refs/heads/sqoop2
Commit: 39ab0a6f254f6c47282db44f240c78472f03b19f
Parents: 3349ae2
Author: Jarek Jarcec Cecho <[email protected]>
Authored: Thu Nov 20 20:16:07 2014 -0800
Committer: Jarek Jarcec Cecho <[email protected]>
Committed: Thu Nov 20 20:16:07 2014 -0800

----------------------------------------------------------------------
 .../org/apache/sqoop/security/AuthenticationConstants.java    | 7 +++++++
 dist/src/main/server/conf/sqoop.properties                    | 1 +
 .../org/apache/sqoop/filter/SqoopAuthenticationFilter.java    | 2 ++
 3 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/39ab0a6f/core/src/main/java/org/apache/sqoop/security/AuthenticationConstants.java
----------------------------------------------------------------------
diff --git 
a/core/src/main/java/org/apache/sqoop/security/AuthenticationConstants.java 
b/core/src/main/java/org/apache/sqoop/security/AuthenticationConstants.java
index 26f83a9..f37e505 100644
--- a/core/src/main/java/org/apache/sqoop/security/AuthenticationConstants.java
+++ b/core/src/main/java/org/apache/sqoop/security/AuthenticationConstants.java
@@ -48,6 +48,13 @@ public final class AuthenticationConstants {
           PREFIX_AUTHENTICATION_CONFIG + "handler";
 
   /**
+   * The config enables or disables anonymous authentication.
+   * <tt>org.apache.sqoop.authentication.anonymous</tt>.
+   */
+  public static final String AUTHENTICATION_ANONYMOUS =
+      PREFIX_AUTHENTICATION_CONFIG + "anonymous";
+
+  /**
    * All kerberos authentication related configuration is prefixed with this:
    * <tt>org.apache.sqoop.authentication.kerberos.</tt>
    */

http://git-wip-us.apache.org/repos/asf/sqoop/blob/39ab0a6f/dist/src/main/server/conf/sqoop.properties
----------------------------------------------------------------------
diff --git a/dist/src/main/server/conf/sqoop.properties 
b/dist/src/main/server/conf/sqoop.properties
index 1666283..3d18e7b 100755
--- a/dist/src/main/server/conf/sqoop.properties
+++ b/dist/src/main/server/conf/sqoop.properties
@@ -146,6 +146,7 @@ 
org.apache.sqoop.execution.engine=org.apache.sqoop.execution.mapreduce.Mapreduce
 #
 org.apache.sqoop.authentication.type=SIMPLE
 
org.apache.sqoop.authentication.handler=org.apache.sqoop.security.SimpleAuthenticationHandler
+#org.apache.sqoop.anonymous=true
 #org.apache.sqoop.authentication.type=KERBEROS
 
#org.apache.sqoop.authentication.handler=org.apache.sqoop.security.KerberosAuthenticationHandler
 #org.apache.sqoop.authentication.kerberos.principal=sqoop/_HOST@NOVALOCAL

http://git-wip-us.apache.org/repos/asf/sqoop/blob/39ab0a6f/server/src/main/java/org/apache/sqoop/filter/SqoopAuthenticationFilter.java
----------------------------------------------------------------------
diff --git 
a/server/src/main/java/org/apache/sqoop/filter/SqoopAuthenticationFilter.java 
b/server/src/main/java/org/apache/sqoop/filter/SqoopAuthenticationFilter.java
index a6a79d3..4165b86 100644
--- 
a/server/src/main/java/org/apache/sqoop/filter/SqoopAuthenticationFilter.java
+++ 
b/server/src/main/java/org/apache/sqoop/filter/SqoopAuthenticationFilter.java
@@ -71,6 +71,8 @@ public class SqoopAuthenticationFilter extends 
AuthenticationFilter {
       properties.setProperty(KerberosAuthenticationHandler.KEYTAB, keytab);
     } else if 
(type.equalsIgnoreCase(AuthenticationConstants.TYPE.SIMPLE.name())) {
       properties.setProperty(AUTH_TYPE, 
PseudoAuthenticationHandler.class.getName());
+      properties.setProperty(PseudoAuthenticationHandler.ANONYMOUS_ALLOWED,
+          
mapContext.getString(AuthenticationConstants.AUTHENTICATION_ANONYMOUS, 
"true").trim());
     } else {
       throw new SqoopException(AuthenticationError.AUTH_0004, type);
     }

Reply via email to