Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6B1D7108F2 for ; Thu, 18 Apr 2013 00:50:41 +0000 (UTC) Received: (qmail 48434 invoked by uid 500); 18 Apr 2013 00:50:41 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 48402 invoked by uid 500); 18 Apr 2013 00:50:41 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 48395 invoked by uid 99); 18 Apr 2013 00:50:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Apr 2013 00:50:41 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Apr 2013 00:50:35 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id F29E823888FE; Thu, 18 Apr 2013 00:50:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1469113 [2/2] - in /accumulo/branches/1.5: assemble/ conf/examples/1GB/native-standalone/ conf/examples/1GB/standalone/ conf/examples/2GB/native-standalone/ conf/examples/2GB/standalone/ conf/examples/3GB/native-standalone/ conf/examples/3... Date: Thu, 18 Apr 2013 00:50:11 -0000 To: commits@accumulo.apache.org From: kturner@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130418005013.F29E823888FE@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: accumulo/branches/1.5/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java?rev=1469113&r1=1469112&r2=1469113&view=diff ============================================================================== --- accumulo/branches/1.5/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java (original) +++ accumulo/branches/1.5/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java Thu Apr 18 00:50:10 2013 @@ -31,6 +31,7 @@ import java.util.Properties; import java.util.Set; import java.util.TreeMap; +import org.apache.accumulo.core.client.security.tokens.PasswordToken; import org.apache.accumulo.proxy.thrift.ColumnUpdate; import org.apache.accumulo.proxy.thrift.TimeType; import org.apache.thrift.TException; @@ -56,6 +57,7 @@ public class TestProxyTableOperations { public static void setup() throws Exception { Properties prop = new Properties(); prop.setProperty("org.apache.accumulo.proxy.ProxyServer.useMockInstance", "true"); + prop.put("org.apache.accumulo.proxy.ProxyServer.tokenClass", PasswordToken.class.getName()); proxy = Proxy.createProxyServer(Class.forName("org.apache.accumulo.proxy.thrift.AccumuloProxy"), Class.forName("org.apache.accumulo.proxy.ProxyServer"), port, TCompactProtocol.Factory.class, prop); Modified: accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/Accumulo.java URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/Accumulo.java?rev=1469113&r1=1469112&r2=1469113&view=diff ============================================================================== --- accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/Accumulo.java (original) +++ accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/Accumulo.java Thu Apr 18 00:50:10 2013 @@ -26,6 +26,7 @@ import java.util.Map.Entry; import java.util.TreeMap; import org.apache.accumulo.core.Constants; +import org.apache.accumulo.core.conf.Property; import org.apache.accumulo.core.trace.DistributedTrace; import org.apache.accumulo.core.util.CachedConfiguration; import org.apache.accumulo.core.util.UtilWaitThread; @@ -127,7 +128,8 @@ public class Accumulo { sortedProps.put(entry.getKey(), entry.getValue()); for (Entry entry : sortedProps.entrySet()) { - if (entry.getKey().toLowerCase().contains("password") || entry.getKey().toLowerCase().contains("secret")) + if (entry.getKey().toLowerCase().contains("password") || entry.getKey().toLowerCase().contains("secret") + || entry.getKey().startsWith(Property.TRACE_TOKEN_PROPERTY_PREFIX.getKey())) log.info(entry.getKey() + " = "); else log.info(entry.getKey() + " = " + entry.getValue()); Modified: accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java?rev=1469113&r1=1469112&r2=1469113&view=diff ============================================================================== --- accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java (original) +++ accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java Thu Apr 18 00:50:10 2013 @@ -196,6 +196,8 @@ public class ClientServiceHandler implem continue; if (entry.getKey().toLowerCase().contains("password")) continue; + if (entry.getKey().startsWith(Property.TRACE_TOKEN_PROPERTY_PREFIX.getKey())) + continue; result.put(entry.getKey(), entry.getValue()); } return result; @@ -269,9 +271,4 @@ public class ClientServiceHandler implem return false; } } - - @Override - public String getAuthenticatorClassName() throws TException { - return security.getTokenLoginClass(); - } } Modified: accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java?rev=1469113&r1=1469112&r2=1469113&view=diff ============================================================================== --- accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java (original) +++ accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java Thu Apr 18 00:50:10 2013 @@ -19,7 +19,6 @@ package org.apache.accumulo.server.clien import java.nio.ByteBuffer; import java.util.Collections; import java.util.List; -import java.util.Properties; import java.util.UUID; import org.apache.accumulo.core.Constants; @@ -28,16 +27,12 @@ import org.apache.accumulo.core.client.A import org.apache.accumulo.core.client.Connector; import org.apache.accumulo.core.client.Instance; import org.apache.accumulo.core.client.ZooKeeperInstance; -import org.apache.accumulo.core.client.impl.ClientExecReturn; import org.apache.accumulo.core.client.impl.ConnectorImpl; -import org.apache.accumulo.core.client.impl.ServerClient; -import org.apache.accumulo.core.client.impl.thrift.ClientService; import org.apache.accumulo.core.client.security.tokens.AuthenticationToken; import org.apache.accumulo.core.client.security.tokens.PasswordToken; import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.core.conf.Property; import org.apache.accumulo.core.security.CredentialHelper; -import org.apache.accumulo.core.security.handler.Authenticator; import org.apache.accumulo.core.security.thrift.TCredentials; import org.apache.accumulo.core.util.ByteBufferUtil; import org.apache.accumulo.core.util.OpTimer; @@ -203,37 +198,4 @@ public class HdfsZooInstance implements public Connector getConnector(org.apache.accumulo.core.security.thrift.AuthInfo auth) throws AccumuloException, AccumuloSecurityException { return getConnector(auth.user, auth.getPassword()); } - - @Override - public String getAuthenticatorClassName() throws AccumuloException, AccumuloSecurityException { - return ServerClient.execute(this, new ClientExecReturn() { - @Override - public String execute(ClientService.Client iface) throws Exception { - return iface.getAuthenticatorClassName(); - } - }); - } - - @Override - public Authenticator getAuthenticator() throws AccumuloException, AccumuloSecurityException { - String authenticatorName = getAuthenticatorClassName(); - try { - Class clazz = Class.forName(authenticatorName); - Class authClass = clazz.asSubclass(Authenticator.class); - Authenticator authenticator = authClass.newInstance(); - return authenticator; - } catch (ClassNotFoundException e) { - throw new AccumuloException(e); - } catch (InstantiationException e) { - throw new AccumuloException(e); - } catch (IllegalAccessException e) { - throw new AccumuloException(e); - } - } - - public Connector getConnector(String principal, Properties props) throws AccumuloException, AccumuloSecurityException { - Authenticator authenticator = getAuthenticator(); - AuthenticationToken authToken = authenticator.login(principal, props); - return getConnector(principal, authToken); - } } Modified: accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Basic.java URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Basic.java?rev=1469113&r1=1469112&r2=1469113&view=diff ============================================================================== --- accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Basic.java (original) +++ accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Basic.java Thu Apr 18 00:50:10 2013 @@ -36,6 +36,7 @@ import org.apache.accumulo.core.trace.Tr import org.apache.accumulo.server.client.HdfsZooInstance; import org.apache.accumulo.server.monitor.Monitor; import org.apache.accumulo.server.monitor.servlets.BasicServlet; +import org.apache.accumulo.start.classloader.AccumuloClassLoader; abstract class Basic extends BasicServlet { @@ -68,27 +69,28 @@ abstract class Basic extends BasicServle protected Scanner getScanner(StringBuilder sb) throws AccumuloException, AccumuloSecurityException { AccumuloConfiguration conf = Monitor.getSystemConfiguration(); - String principal = conf.get(Property.TRACE_PRINCIPAL); - if (principal == null) { - @SuppressWarnings("deprecation") - Property p = Property.TRACE_USER; - principal = conf.get(p); - } + String principal = conf.get(Property.TRACE_USER); AuthenticationToken at; - Map loginMap = conf.getAllPropertiesWithPrefix(Property.TRACE_LOGIN_PROPERTIES); + Map loginMap = conf.getAllPropertiesWithPrefix(Property.TRACE_TOKEN_PROPERTY_PREFIX); if (loginMap.isEmpty()) { - @SuppressWarnings("deprecation") Property p = Property.TRACE_PASSWORD; at = new PasswordToken(conf.get(p).getBytes()); } else { Properties props = new Properties(); - int prefixLength = Property.TRACE_LOGIN_PROPERTIES.getKey().length() + 1; + int prefixLength = Property.TRACE_TOKEN_PROPERTY_PREFIX.getKey().length() + 1; for (Entry entry : loginMap.entrySet()) { props.put(entry.getKey().substring(prefixLength), entry.getValue()); } - if (!props.containsKey("principal")) - props.put("principal", principal); - at = HdfsZooInstance.getInstance().getAuthenticator().login(principal, props); + + AuthenticationToken token; + try { + token = AccumuloClassLoader.getClassLoader().loadClass(conf.get(Property.TRACE_TOKEN_TYPE)).asSubclass(AuthenticationToken.class).newInstance(); + } catch (Exception e) { + throw new AccumuloException(e); + } + + token.init(props); + at = token; } String table = conf.get(Property.TRACE_TABLE); Modified: accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java?rev=1469113&r1=1469112&r2=1469113&view=diff ============================================================================== --- accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java (original) +++ accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java Thu Apr 18 00:50:10 2013 @@ -612,8 +612,4 @@ public class SecurityOperation { authenticate(credentials); return hasSystemPermission(credentials.getPrincipal(), SystemPermission.CREATE_TABLE, false); } - - public String getTokenLoginClass() { - return authenticator.getTokenLoginClass(); - } } Modified: accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/security/handler/Authenticator.java URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/security/handler/Authenticator.java?rev=1469113&r1=1469112&r2=1469113&view=diff ============================================================================== --- accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/security/handler/Authenticator.java (original) +++ accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/security/handler/Authenticator.java Thu Apr 18 00:50:10 2013 @@ -28,7 +28,7 @@ import org.apache.accumulo.core.security * should throw an AccumuloSecurityException with the error code UNSUPPORTED_OPERATION */ -public interface Authenticator extends org.apache.accumulo.core.security.handler.Authenticator { +public interface Authenticator { public void initialize(String instanceId, boolean initialize); @@ -48,7 +48,7 @@ public interface Authenticator extends o public boolean userExists(String user) throws AccumuloSecurityException; - public String getTokenLoginClass(); + public Set> getSupportedTokenTypes(); /** * Returns true if the given token is appropriate for this Authenticator 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=1469113&r1=1469112&r2=1469113&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 Apr 18 00:50:10 2013 @@ -17,6 +17,7 @@ package org.apache.accumulo.server.security.handler; import java.util.Collections; +import java.util.HashSet; import java.util.Set; import org.apache.accumulo.core.client.AccumuloSecurityException; @@ -28,7 +29,7 @@ import org.apache.accumulo.core.security * 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 { +public class InsecureAuthenticator implements Authenticator { @Override public void initialize(String instanceId, boolean initialize) { @@ -76,13 +77,15 @@ public class InsecureAuthenticator exten } @Override - public String getTokenLoginClass() { - return this.getClass().getSuperclass().getName(); - } - - @Override public boolean validTokenClass(String tokenClass) { return tokenClass.equals(NullToken.class.getName()); } + + @Override + public Set> getSupportedTokenTypes() { + Set> cs = new HashSet>(); + cs.add(NullToken.class); + return cs; + } } Modified: accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/security/handler/ZKAuthenticator.java URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/security/handler/ZKAuthenticator.java?rev=1469113&r1=1469112&r2=1469113&view=diff ============================================================================== --- accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/security/handler/ZKAuthenticator.java (original) +++ accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/security/handler/ZKAuthenticator.java Thu Apr 18 00:50:10 2013 @@ -16,6 +16,7 @@ */ package org.apache.accumulo.server.security.handler; +import java.util.HashSet; import java.util.Set; import java.util.TreeSet; @@ -35,7 +36,7 @@ import org.apache.log4j.Logger; import org.apache.zookeeper.KeeperException; // Utility class for adding all authentication info into ZK -public final class ZKAuthenticator extends org.apache.accumulo.core.security.handler.ZKAuthenticator implements Authenticator { +public final class ZKAuthenticator implements Authenticator { static final Logger log = Logger.getLogger(ZKAuthenticator.class); private static Authenticator zkAuthenticatorInstance = null; @@ -199,8 +200,10 @@ public final class ZKAuthenticator exten } @Override - public String getTokenLoginClass() { - return this.getClass().getSuperclass().getName(); + public Set> getSupportedTokenTypes() { + Set> cs = new HashSet>(); + cs.add(PasswordToken.class); + return cs; } @Override Modified: accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java?rev=1469113&r1=1469112&r2=1469113&view=diff ============================================================================== --- accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java (original) +++ accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java Thu Apr 18 00:50:10 2013 @@ -49,6 +49,7 @@ import org.apache.accumulo.server.client import org.apache.accumulo.server.conf.ServerConfiguration; import org.apache.accumulo.server.util.time.SimpleTimer; import org.apache.accumulo.server.zookeeper.ZooReaderWriter; +import org.apache.accumulo.start.classloader.AccumuloClassLoader; import org.apache.accumulo.trace.instrument.Span; import org.apache.accumulo.trace.thrift.RemoteSpan; import org.apache.accumulo.trace.thrift.SpanReceiver.Iface; @@ -160,25 +161,25 @@ public class TraceServer implements Watc table = conf.get(Property.TRACE_TABLE); while (true) { try { - String principal = conf.get(Property.TRACE_PRINCIPAL); - if (principal == null) { - @SuppressWarnings("deprecation") - Property p = Property.TRACE_USER; - principal = conf.get(p); - } + String principal = conf.get(Property.TRACE_USER); AuthenticationToken at; - Map loginMap = conf.getAllPropertiesWithPrefix(Property.TRACE_LOGIN_PROPERTIES); - if (loginMap == null) { - @SuppressWarnings("deprecation") + Map loginMap = conf.getAllPropertiesWithPrefix(Property.TRACE_TOKEN_PROPERTY_PREFIX); + if (loginMap.isEmpty()) { Property p = Property.TRACE_PASSWORD; at = new PasswordToken(conf.get(p).getBytes()); } else { Properties props = new Properties(); - int prefixLength = Property.TRACE_LOGIN_PROPERTIES.getKey().length() + 1; + AuthenticationToken token = AccumuloClassLoader.getClassLoader().loadClass(conf.get(Property.TRACE_TOKEN_TYPE)).asSubclass(AuthenticationToken.class) + .newInstance(); + + int prefixLength = Property.TRACE_TOKEN_PROPERTY_PREFIX.getKey().length() + 1; for (Entry entry : loginMap.entrySet()) { props.put(entry.getKey().substring(prefixLength), entry.getValue()); } - at = serverConfiguration.getInstance().getAuthenticator().login(principal, props); + + token.init(props); + + at = token; } connector = serverConfiguration.getInstance().getConnector(principal, at); Copied: accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/util/LoginProperties.java (from r1469003, accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/util/LoginProperties.java) URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/util/LoginProperties.java?p2=accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/util/LoginProperties.java&p1=accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/util/LoginProperties.java&r1=1469003&r2=1469113&rev=1469113&view=diff ============================================================================== --- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/util/LoginProperties.java (original) +++ accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/util/LoginProperties.java Thu Apr 18 00:50:10 2013 @@ -14,18 +14,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.accumulo.core.util; +package org.apache.accumulo.server.util; +import java.util.ArrayList; +import java.util.List; import java.util.Set; -import java.util.UUID; -import org.apache.accumulo.core.cli.ClientOpts; -import org.apache.accumulo.core.client.Instance; -import org.apache.accumulo.core.client.ZooKeeperInstance; +import org.apache.accumulo.core.client.security.tokens.AuthenticationToken; +import org.apache.accumulo.core.client.security.tokens.AuthenticationToken.TokenProperty; import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.core.conf.Property; -import org.apache.accumulo.core.security.handler.Authenticator; -import org.apache.hadoop.fs.Path; +import org.apache.accumulo.server.client.HdfsZooInstance; +import org.apache.accumulo.server.conf.ServerConfiguration; +import org.apache.accumulo.server.security.handler.Authenticator; +import org.apache.accumulo.start.classloader.AccumuloClassLoader; /** * @@ -35,46 +37,26 @@ public class LoginProperties { /** * @param args */ - public static void main(String[] args) { - ClientOpts opts = new ClientOpts(); - opts.parseArgs(LoginProperties.class.getName(), args); - String indent = " "; + public static void main(String[] args) throws Exception { + AccumuloConfiguration config = ServerConfiguration.getSystemConfiguration(HdfsZooInstance.getInstance()); + Authenticator authenticator = AccumuloClassLoader.getClassLoader().loadClass(config.get(Property.INSTANCE_SECURITY_AUTHENTICATOR)) + .asSubclass(Authenticator.class).newInstance(); - try { - String or = null; - System.out.println("Acceptable login properties are: "); - Instance instance; - if (opts.instance == null) { - @SuppressWarnings("deprecation") - AccumuloConfiguration deprecatedSiteConfiguration = AccumuloConfiguration.getSiteConfiguration(); - instance = getDefaultInstance(deprecatedSiteConfiguration); - } else - instance = opts.getInstance(); - for (Set set : instance.getAuthenticator().getProperties()) { - if (or == null) - or = "OR"; - else - System.out.println(or); - String and = null; - for (Authenticator.AuthProperty ap : set) { - if (and == null) - and = indent + "AND"; - else - System.out.println(and); - System.out.println(indent + ap); - } + List> tokenProps = new ArrayList>(); + + for (Class tokenType : authenticator.getSupportedTokenTypes()) { + tokenProps.add(tokenType.newInstance().getProperties()); + } + + System.out.println("Supported token types for " + authenticator.getClass().getName() + " are : "); + for (Class tokenType : authenticator.getSupportedTokenTypes()) { + System.out.println("\t" + tokenType.getName() + ", which accepts the following properties : "); + + for (TokenProperty tokenProperty : tokenType.newInstance().getProperties()) { + System.out.println("\t\t" + tokenProperty); } - } catch (Exception e) { - throw new RuntimeException(e); + System.out.println(); } } - - @SuppressWarnings("deprecation") - private static Instance getDefaultInstance(AccumuloConfiguration conf) { - String keepers = conf.get(Property.INSTANCE_ZK_HOST); - Path instanceDir = new Path(conf.get(Property.INSTANCE_DFS_DIR), "instance_id"); - return new ZooKeeperInstance(UUID.fromString(ZooKeeperInstance.getInstanceIDFromHdfs(instanceDir)), keepers); - } - } Modified: accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java?rev=1469113&r1=1469112&r2=1469113&view=diff ============================================================================== --- accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java (original) +++ accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java Thu Apr 18 00:50:10 2013 @@ -263,7 +263,7 @@ public class MiniAccumuloCluster { appendProp(fileWriter, Property.TSERV_MAXMEM, "50M", siteConfig); appendProp(fileWriter, Property.TSERV_WALOG_MAX_SIZE, "100M", siteConfig); appendProp(fileWriter, Property.TSERV_NATIVEMAP_ENABLED, "false", siteConfig); - appendProp(fileWriter, Property.TRACE_LOGIN_PROPERTIES + ".password", config.getRootPassword(), siteConfig); + appendProp(fileWriter, Property.TRACE_TOKEN_PROPERTY_PREFIX + ".password", config.getRootPassword(), siteConfig); appendProp(fileWriter, Property.TRACE_PORT, "" + getRandomFreePort(), siteConfig); // since there is a small amount of memory, check more frequently for majc... setting may not be needed in 1.5 appendProp(fileWriter, Property.TSERV_MAJC_DELAY, "3", siteConfig); Modified: accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java?rev=1469113&r1=1469112&r2=1469113&view=diff ============================================================================== --- accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java (original) +++ accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java Thu Apr 18 00:50:10 2013 @@ -18,10 +18,8 @@ package org.apache.accumulo.test.randomw import java.io.IOException; import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; +import java.util.HashSet; import java.util.Map; -import java.util.Properties; import java.util.Set; import java.util.TreeSet; @@ -400,27 +398,18 @@ public class WalkingSecurity extends Sec } @Override - public AuthenticationToken login(String principal, Properties properties) throws AccumuloSecurityException { - if (properties.containsKey("password")) - return new PasswordToken(properties.getProperty("password")); - throw new AccumuloSecurityException(principal, SecurityErrorCode.INSUFFICIENT_PROPERTIES); - } - - @Override public boolean validTokenClass(String tokenClass) { return tokenClass.equals(PasswordToken.class.getCanonicalName()); } - @Override - public List> getProperties() { - List> toRet = new LinkedList>(); - Set internal = new TreeSet(); - internal.add(new AuthProperty("password", "the password for the principal", true)); - toRet.add(internal); - return toRet; - } - public static void clearInstance() { instance = null; } + + @Override + public Set> getSupportedTokenTypes() { + Set> cs = new HashSet>(); + cs.add(PasswordToken.class); + return cs; + } }