You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by vi...@apache.org on 2013/02/28 23:53:22 UTC
svn commit: r1451414 - in /accumulo/branches/1.5:
core/src/main/java/org/apache/accumulo/core/security/handler/
core/src/main/java/org/apache/accumulo/core/security/tokens/
server/src/main/java/org/apache/accumulo/server/security/handler/
Author: vines
Date: Thu Feb 28 22:53:22 2013
New Revision: 1451414
URL: http://svn.apache.org/r1451414
Log:
ACCUMULO-1131 - info & tests on InsecureAuthenticator
Modified:
accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler/InsecureAuthenticator.java
accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/tokens/NullToken.java
accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/security/handler/InsecureAuthenticator.java
Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler/InsecureAuthenticator.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler/InsecureAuthenticator.java?rev=1451414&r1=1451413&r2=1451414&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler/InsecureAuthenticator.java (original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler/InsecureAuthenticator.java Thu Feb 28 22:53:22 2013
@@ -26,10 +26,10 @@ import org.apache.accumulo.core.security
*
*/
public class InsecureAuthenticator implements Authenticator {
-
+ static NullToken nt = new NullToken();
@Override
public AuthenticationToken login(Properties properties) throws AccumuloSecurityException {
- return new NullToken();
+ return nt;
}
}
Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/tokens/NullToken.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/tokens/NullToken.java?rev=1451414&r1=1451413&r2=1451414&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/tokens/NullToken.java (original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/tokens/NullToken.java Thu Feb 28 22:53:22 2013
@@ -50,4 +50,8 @@ public class NullToken implements Authen
public NullToken clone() {
return new NullToken();
}
+
+ public boolean equals(Object obj) {
+ return obj instanceof NullToken;
+ }
}
Modified: accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/security/handler/InsecureAuthenticator.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/security/handler/InsecureAuthenticator.java?rev=1451414&r1=1451413&r2=1451414&view=diff
==============================================================================
--- accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/security/handler/InsecureAuthenticator.java (original)
+++ accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/security/handler/InsecureAuthenticator.java Thu Feb 28 22:53:22 2013
@@ -25,7 +25,8 @@ import org.apache.accumulo.core.security
import org.apache.accumulo.core.security.tokens.AuthenticationToken;
/**
- * This is an Authenticator implementation that doesn't actually do any security. Use at your own risk.
+ * This is an Authenticator implementation that doesn't actually do any security. Any principal will authenticate if a NullToken is provided. It's existence is
+ * primarily for testing, but can also be used for any system where user space management is not a concern.
*/
public class InsecureAuthenticator extends org.apache.accumulo.core.security.handler.InsecureAuthenticator implements Authenticator {
@@ -46,7 +47,7 @@ public class InsecureAuthenticator exten
@Override
public boolean authenticateUser(String principal, AuthenticationToken token) {
- return true;
+ return token instanceof NullToken;
}
@Override
@@ -68,20 +69,20 @@ public class InsecureAuthenticator exten
public void changePassword(String user, AuthenticationToken token) throws AccumuloSecurityException {
return;
}
-
+
@Override
public boolean userExists(String user) {
return true;
}
-
+
@Override
public String getTokenLoginClass() {
- return null;
+ return org.apache.accumulo.core.security.handler.InsecureAuthenticator.class.getName();
}
-
+
@Override
public boolean validTokenClass(String tokenClass) {
- return tokenClass.equals(NullToken.class.getCanonicalName());
+ return tokenClass.equals(NullToken.class.getName());
}
}