sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject sqoop git commit: SQOOP-1792: Sqoop2: Default to simple authentication type
Date Mon, 24 Nov 2014 05:08:38 GMT
Repository: sqoop
Updated Branches:
  refs/heads/sqoop2 ad35c19a1 -> ae9c6e354


SQOOP-1792: Sqoop2: Default to simple authentication type

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

Branch: refs/heads/sqoop2
Commit: ae9c6e35425515e7419687cbfe860ee1ed58a791
Parents: ad35c19
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Sun Nov 23 21:08:13 2014 -0800
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Sun Nov 23 21:08:13 2014 -0800

----------------------------------------------------------------------
 .../org/apache/sqoop/security/AuthenticationManager.java    | 9 ++++++++-
 dist/src/main/server/conf/sqoop.properties                  | 4 ++--
 .../org/apache/sqoop/filter/SqoopAuthenticationFilter.java  | 3 ++-
 3 files changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/ae9c6e35/core/src/main/java/org/apache/sqoop/security/AuthenticationManager.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/sqoop/security/AuthenticationManager.java b/core/src/main/java/org/apache/sqoop/security/AuthenticationManager.java
index 1f7248b..a014ab3 100644
--- a/core/src/main/java/org/apache/sqoop/security/AuthenticationManager.java
+++ b/core/src/main/java/org/apache/sqoop/security/AuthenticationManager.java
@@ -28,6 +28,11 @@ public class AuthenticationManager implements Reconfigurable {
 
   private static final Logger LOG = Logger.getLogger(AuthenticationManager.class);
 
+  /**
+   * Default authentication handler
+   */
+  public static final String DEFAULT_AUTHENTICATION_HANDLER = "org.apache.sqoop.security.SimpleAuthenticationHandler";
+
 
   /**
    * Default authentication auto upgrade option value
@@ -86,7 +91,9 @@ public class AuthenticationManager implements Reconfigurable {
       LOG.trace("Begin authentication manager initialization");
     }
 
-    String handler = SqoopConfiguration.getInstance().getContext().getString(AuthenticationConstants.AUTHENTICATION_HANDLER.trim());
+    String handler = SqoopConfiguration.getInstance().getContext().getString(
+        AuthenticationConstants.AUTHENTICATION_HANDLER,
+        DEFAULT_AUTHENTICATION_HANDLER).trim();
     authenticationHandler = AuthenticationHandlerFactory.getAuthenticationHandler(handler);
     authenticationHandler.doInitialize();
     authenticationHandler.secureLogin();

http://git-wip-us.apache.org/repos/asf/sqoop/blob/ae9c6e35/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 3d18e7b..26bf734 100755
--- a/dist/src/main/server/conf/sqoop.properties
+++ b/dist/src/main/server/conf/sqoop.properties
@@ -144,8 +144,8 @@ org.apache.sqoop.execution.engine=org.apache.sqoop.execution.mapreduce.Mapreduce
 #
 # Authentication configuration
 #
-org.apache.sqoop.authentication.type=SIMPLE
-org.apache.sqoop.authentication.handler=org.apache.sqoop.security.SimpleAuthenticationHandler
+#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

http://git-wip-us.apache.org/repos/asf/sqoop/blob/ae9c6e35/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 4165b86..bb66290 100644
--- a/server/src/main/java/org/apache/sqoop/filter/SqoopAuthenticationFilter.java
+++ b/server/src/main/java/org/apache/sqoop/filter/SqoopAuthenticationFilter.java
@@ -40,7 +40,8 @@ public class SqoopAuthenticationFilter extends AuthenticationFilter {
     Properties properties = super.getConfiguration(configPrefix, filterConfig);
     MapContext mapContext = SqoopConfiguration.getInstance().getContext();
     String type = mapContext.getString(
-            AuthenticationConstants.AUTHENTICATION_TYPE).trim();
+        AuthenticationConstants.AUTHENTICATION_TYPE,
+        AuthenticationConstants.TYPE.SIMPLE.name()).trim();
 
     if (type.equalsIgnoreCase(AuthenticationConstants.TYPE.KERBEROS.name())) {
       properties.setProperty(AUTH_TYPE, AuthenticationConstants.TYPE.KERBEROS.name().toLowerCase());


Mime
View raw message