accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1452556 - in /accumulo/branches/1.5: core/src/main/java/org/apache/accumulo/core/client/ core/src/main/java/org/apache/accumulo/core/client/mock/ core/src/main/java/org/apache/accumulo/core/security/handler/ core/src/main/java/org/apache/a...
Date Mon, 04 Mar 2013 21:58:00 GMT
Author: vines
Date: Mon Mar  4 21:58:00 2013
New Revision: 1452556

URL: http://svn.apache.org/r1452556
Log:
ACCUMULO-1129 - Implemented new getConnector methods and getProperties in the client side
handler. Also fixed a bug with the way I was having ZKAuthetnicator and InsecureAuthenticator
getting the parent (core) class.


Modified:
    accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/Instance.java
    accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java
    accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstance.java
    accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler/Authenticator.java
    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/handler/ZKAuthenticator.java
    accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/thrift/ThriftSecurityException.java
    accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java
    accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
    accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/security/handler/InsecureAuthenticator.java
    accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/security/handler/ZKAuthenticator.java
    accumulo/branches/1.5/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java

Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/Instance.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/Instance.java?rev=1452556&r1=1452555&r2=1452556&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/Instance.java
(original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/Instance.java
Mon Mar  4 21:58:00 2013
@@ -84,7 +84,9 @@ public interface Instance {
    *           when a generic exception occurs
    * @throws AccumuloSecurityException
    *           when a user's credentials are invalid
+   * @deprecated since 1.5, use {@link #getConnector(Properties)}
    */
+  @Deprecated
   public abstract Connector getConnector(String user, byte[] pass) throws AccumuloException,
AccumuloSecurityException;
   
   /**
@@ -114,7 +116,9 @@ public interface Instance {
    *           when a generic exception occurs
    * @throws AccumuloSecurityException
    *           when a user's credentials are invalid
+   * @deprecated since 1.5, use {@link #getConnector(Properties)}
    */
+  @Deprecated
   public abstract Connector getConnector(String user, ByteBuffer pass) throws AccumuloException,
AccumuloSecurityException;
   
   /**
@@ -129,7 +133,9 @@ public interface Instance {
    *           when a generic exception occurs
    * @throws AccumuloSecurityException
    *           when a user's credentials are invalid
+   * @deprecated since 1.5, use {@link #getConnector(Properties)}
    */
+  @Deprecated
   public abstract Connector getConnector(String user, CharSequence pass) throws AccumuloException,
AccumuloSecurityException;
   
   /**
@@ -169,4 +175,23 @@ public interface Instance {
    * @throws AccumuloSecurityException
    */
   Connector getConnector(TCredentials auth) throws AccumuloException, AccumuloSecurityException;
+  
+  /**
+   * @param principal
+   *          The principal the authentication token corresponds to
+   * @param props
+   *          The properties necessary to construct an AuthenticationToken in the current
security configuration
+   * @throws AccumuloException
+   * @throws AccumuloSecurityException
+   */
+  Connector getConnector(String principal, Properties props) throws AccumuloException, AccumuloSecurityException;
+  
+  /**
+   * 
+   * @return Returns the corresponding Authenticator class, which can be used to create a
token ({@link Authenticator#login(Properties)} or get a list of
+   *         required properties {@link Authenticator#getProperties()}
+   * @throws AccumuloException
+   * @throws AccumuloSecurityException
+   */
+  Authenticator getAuthenticator() throws AccumuloException, AccumuloSecurityException;
 }

Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java?rev=1452556&r1=1452555&r2=1452556&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java
(original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java
Mon Mar  4 21:58:00 2013
@@ -20,6 +20,7 @@ import java.io.IOException;
 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;
@@ -33,6 +34,7 @@ import org.apache.accumulo.core.conf.Pro
 import org.apache.accumulo.core.file.FileUtil;
 import org.apache.accumulo.core.master.thrift.MasterClientService.Client;
 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.ArgumentChecker;
 import org.apache.accumulo.core.util.ByteBufferUtil;
@@ -211,11 +213,13 @@ public class ZooKeeperInstance implement
   }
   
   @Override
+  @Deprecated
   public Connector getConnector(String user, CharSequence pass) throws AccumuloException,
AccumuloSecurityException {
     return getConnector(user, TextUtil.getBytes(new Text(pass.toString())));
   }
   
   @Override
+  @Deprecated
   public Connector getConnector(String user, ByteBuffer pass) throws AccumuloException, AccumuloSecurityException
{
     return getConnector(user, ByteBufferUtil.toBytes(pass));
   }
@@ -231,7 +235,14 @@ public class ZooKeeperInstance implement
     return new ConnectorImpl(this, credential);
   }
   
+  public Connector getConnector(String principal, Properties props) throws AccumuloException,
AccumuloSecurityException {
+    Authenticator authenticator = getAuthenticator();
+    AuthenticationToken authToken = authenticator.login(props);
+    return getConnector(principal, authToken);
+  }
+  
   @Override
+  @Deprecated
   public Connector getConnector(String principal, byte[] pass) throws AccumuloException,
AccumuloSecurityException {
     return getConnector(principal, new PasswordToken(pass));
   }
@@ -326,4 +337,20 @@ public class ZooKeeperInstance implement
     }
   }
   
+  @Override
+  public Authenticator getAuthenticator() throws AccumuloException {
+    String authenticatorName = getAuthenticatorClassName();
+    try {
+      Class<?> clazz = Class.forName(authenticatorName);
+      Class<? extends Authenticator> 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);
+    }
+  }
 }

Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstance.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstance.java?rev=1452556&r1=1452555&r2=1452556&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstance.java
(original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstance.java
Mon Mar  4 21:58:00 2013
@@ -22,6 +22,7 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -32,6 +33,7 @@ import org.apache.accumulo.core.client.s
 import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.security.CredentialHelper;
+import org.apache.accumulo.core.security.handler.Authenticator;
 import org.apache.accumulo.core.security.handler.ZKAuthenticator;
 import org.apache.accumulo.core.security.thrift.TCredentials;
 import org.apache.accumulo.core.util.ByteBufferUtil;
@@ -116,16 +118,19 @@ public class MockInstance implements Ins
   }
   
   @Override
+  @Deprecated
   public Connector getConnector(String user, byte[] pass) throws AccumuloException, AccumuloSecurityException
{
     return getConnector(user, new PasswordToken(pass));
   }
   
   @Override
+  @Deprecated
   public Connector getConnector(String user, ByteBuffer pass) throws AccumuloException, AccumuloSecurityException
{
     return getConnector(user, ByteBufferUtil.toBytes(pass));
   }
   
   @Override
+  @Deprecated
   public Connector getConnector(String user, CharSequence pass) throws AccumuloException,
AccumuloSecurityException {
     return getConnector(user, TextUtil.getBytes(new Text(pass.toString())));
   }
@@ -169,4 +174,14 @@ public class MockInstance implements Ins
   public Connector getConnector(TCredentials credential) throws AccumuloException, AccumuloSecurityException
{
     return getConnector(credential.principal, CredentialHelper.extractToken(credential));
   }
+
+  @Override
+  public Connector getConnector(String principal, Properties props) throws AccumuloException,
AccumuloSecurityException {
+    return getConnector(principal, getAuthenticator().login(props));
+  }
+
+  @Override
+  public Authenticator getAuthenticator() throws AccumuloException, AccumuloSecurityException
{
+    return new ZKAuthenticator();
+  }
 }

Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler/Authenticator.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler/Authenticator.java?rev=1452556&r1=1452555&r2=1452556&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler/Authenticator.java
(original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler/Authenticator.java
Mon Mar  4 21:58:00 2013
@@ -16,11 +16,36 @@
  */
 package org.apache.accumulo.core.security.handler;
 
+import java.util.List;
 import java.util.Properties;
+import java.util.Set;
 
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
 
 public interface Authenticator {
   public AuthenticationToken login(Properties properties) throws AccumuloSecurityException;
+  
+  public List<Set<AuthProperty>> getProperties();
+  
+  public class AuthProperty {
+    private String key, description;
+    
+    public AuthProperty(String name, String description) {
+      this.key = name;
+      this.description = description;
+    }
+
+    public String toString() {
+      return this.key + " - " + description;
+    }
+    
+    public String getKey() {
+      return this.key;
+    }
+    
+    public String getDescription() {
+      return this.description;
+    }
+  }
 }

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=1452556&r1=1452555&r2=1452556&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
Mon Mar  4 21:58:00 2013
@@ -16,7 +16,11 @@
  */
 package org.apache.accumulo.core.security.handler;
 
+import java.util.LinkedList;
+import java.util.List;
 import java.util.Properties;
+import java.util.Set;
+import java.util.TreeSet;
 
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
@@ -27,9 +31,17 @@ import org.apache.accumulo.core.client.s
  */
 public class InsecureAuthenticator implements Authenticator {
   static NullToken nt = new NullToken();
+  
   @Override
   public AuthenticationToken login(Properties properties) throws AccumuloSecurityException
{
     return nt;
   }
   
+  @Override
+  public List<Set<AuthProperty>> getProperties() {
+    Set<AuthProperty> internal = new TreeSet<AuthProperty>();
+    List<Set<AuthProperty>> toRet = new LinkedList<Set<AuthProperty>>();
+    toRet.add(internal);
+    return toRet;
+  }
 }

Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler/ZKAuthenticator.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler/ZKAuthenticator.java?rev=1452556&r1=1452555&r2=1452556&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler/ZKAuthenticator.java
(original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/handler/ZKAuthenticator.java
Mon Mar  4 21:58:00 2013
@@ -16,7 +16,11 @@
  */
 package org.apache.accumulo.core.security.handler;
 
+import java.util.LinkedList;
+import java.util.List;
 import java.util.Properties;
+import java.util.Set;
+import java.util.TreeSet;
 
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode;
@@ -34,4 +38,13 @@ public class ZKAuthenticator implements 
       return new PasswordToken(properties.getProperty("password"));
     throw new AccumuloSecurityException(properties.getProperty("user"), SecurityErrorCode.INSUFFICIENT_PROPERTIES);
   }
+
+  @Override
+  public List<Set<AuthProperty>> getProperties() {
+    List<Set<AuthProperty>> toRet = new LinkedList<Set<AuthProperty>>();
+    Set<AuthProperty> internal = new TreeSet<AuthProperty>();
+    internal.add(new AuthProperty("password", "the password for the principal"));
+    toRet.add(internal);
+    return toRet;
+  }
 }

Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/thrift/ThriftSecurityException.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/thrift/ThriftSecurityException.java?rev=1452556&r1=1452555&r2=1452556&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/thrift/ThriftSecurityException.java
(original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/security/thrift/ThriftSecurityException.java
Mon Mar  4 21:58:00 2013
@@ -48,7 +48,6 @@ import org.slf4j.LoggerFactory;
 
 /**
  * @deprecated since 1.5, see org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException
- * *
  */
 @SuppressWarnings("all") public class ThriftSecurityException extends TException implements
org.apache.thrift.TBase<ThriftSecurityException, ThriftSecurityException._Fields>, java.io.Serializable,
Cloneable {
   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ThriftSecurityException");

Modified: accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java?rev=1452556&r1=1452555&r2=1452556&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java
(original)
+++ accumulo/branches/1.5/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java
Mon Mar  4 21:58:00 2013
@@ -25,6 +25,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
+import java.util.Properties;
 import java.util.Set;
 import java.util.SortedMap;
 import java.util.TreeMap;
@@ -48,6 +49,7 @@ import org.apache.accumulo.core.data.Mut
 import org.apache.accumulo.core.data.PartialKey;
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.security.handler.Authenticator;
 import org.apache.accumulo.core.security.thrift.TCredentials;
 import org.apache.accumulo.core.util.MetadataTable;
 import org.apache.accumulo.core.util.Pair;
@@ -419,11 +421,13 @@ public class TabletLocatorImplTest exten
     }
     
     @Override
+    @Deprecated
     public Connector getConnector(String user, byte[] pass) throws AccumuloException, AccumuloSecurityException
{
       throw new UnsupportedOperationException();
     }
     
     @Override
+    @Deprecated
     public Connector getConnector(String user, ByteBuffer pass) throws AccumuloException,
AccumuloSecurityException {
       throw new UnsupportedOperationException();
     }
@@ -441,6 +445,7 @@ public class TabletLocatorImplTest exten
     }
     
     @Override
+    @Deprecated
     public Connector getConnector(String user, CharSequence pass) throws AccumuloException,
AccumuloSecurityException {
       throw new UnsupportedOperationException();
     }
@@ -466,6 +471,16 @@ public class TabletLocatorImplTest exten
     public Connector getConnector(String principal, AuthenticationToken token) throws AccumuloException,
AccumuloSecurityException {
       throw new UnsupportedOperationException();
     }
+
+    @Override
+    public Connector getConnector(String principal, Properties props) throws AccumuloException,
AccumuloSecurityException {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    public Authenticator getAuthenticator() throws AccumuloException, AccumuloSecurityException
{
+      throw new UnsupportedOperationException();
+    }
   }
   
   static class TServers {

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=1452556&r1=1452555&r2=1452556&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
Mon Mar  4 21:58:00 2013
@@ -19,6 +19,7 @@ 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;
@@ -36,6 +37,7 @@ import org.apache.accumulo.core.conf.Acc
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.master.thrift.MasterClientService.Client;
 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;
@@ -224,4 +226,27 @@ public class HdfsZooInstance implements 
       }
     }
   }
+  
+  @Override
+  public Authenticator getAuthenticator() throws AccumuloException {
+    String authenticatorName = getAuthenticatorClassName();
+    try {
+      Class<?> clazz = Class.forName(authenticatorName);
+      Class<? extends Authenticator> 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(props);
+    return getConnector(principal, authToken);
+  }
 }

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=1452556&r1=1452555&r2=1452556&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
Mon Mar  4 21:58:00 2013
@@ -77,7 +77,7 @@ public class InsecureAuthenticator exten
   
   @Override
   public String getTokenLoginClass() {
-    return super.getClass().getName();
+    return this.getClass().getSuperclass().getName();
   }
   
   @Override

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=1452556&r1=1452555&r2=1452556&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
Mon Mar  4 21:58:00 2013
@@ -200,7 +200,7 @@ public final class ZKAuthenticator exten
   
   @Override
   public String getTokenLoginClass() {
-    return super.getClass().getCanonicalName();
+    return this.getClass().getSuperclass().getName();
   }
 
   @Override

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=1452556&r1=1452555&r2=1452556&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
Mon Mar  4 21:58:00 2013
@@ -18,6 +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.Map;
 import java.util.Properties;
 import java.util.Set;
@@ -399,4 +401,13 @@ public class WalkingSecurity extends Sec
   public boolean validTokenClass(String tokenClass) {
     return tokenClass.equals(PasswordToken.class.getCanonicalName());
   }
+
+  @Override
+  public List<Set<AuthProperty>> getProperties() {
+    List<Set<AuthProperty>> toRet = new LinkedList<Set<AuthProperty>>();
+    Set<AuthProperty> internal = new TreeSet<AuthProperty>();
+    internal.add(new AuthProperty("password", "the password for the principal"));
+    toRet.add(internal);
+    return toRet;
+  }
 }



Mime
View raw message