accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1439632 [1/3] - in /accumulo/trunk: core/src/main/java/org/apache/accumulo/core/cli/ core/src/main/java/org/apache/accumulo/core/client/ core/src/main/java/org/apache/accumulo/core/client/admin/ core/src/main/java/org/apache/accumulo/core/...
Date Mon, 28 Jan 2013 21:03:45 GMT
Author: vines
Date: Mon Jan 28 21:03:43 2013
New Revision: 1439632

URL: http://svn.apache.org/viewvc?rev=1439632&view=rev
Log:
ACCUMULO-259 - dethrifting client API

Added:
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/tokens/KerberosSerDe.java   (with props)
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/tokens/SecuritySerDe.java   (with props)
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/tokens/SecurityToken.java
      - copied, changed from r1439499, accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/tokens/AccumuloToken.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/tokens/UserPassSerDe.java   (with props)
Removed:
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/tokens/AccumuloToken.java
Modified:
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOnDefaultTable.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOnRequiredTable.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/Instance.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperationsImpl.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/SecurityOperations.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/SecurityOperationsImpl.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/ConnectorImpl.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocator.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloInputFormat.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloRowInputFormat.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/InputFormatBase.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormat.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloRowInputFormat.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/util/ConfiguratorBase.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/util/InputConfigurator.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstance.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockSecurityOperations.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/tokens/InstanceTokenWrapper.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/tokens/KerberosToken.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/tokens/TokenHelper.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/tokens/UserPassToken.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/commands/AuthenticateCommand.java
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/iterators/user/TransformingIteratorTest.java
    accumulo/trunk/examples/instamo/src/main/java/org/apache/accumulo/instamo/AccumuloApp.java
    accumulo/trunk/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/FileDataQuery.java
    accumulo/trunk/examples/simple/src/main/java/org/apache/accumulo/examples/simple/mapreduce/TableToFile.java
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/gc/GarbageCollectWriteAheadLogs.java
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/Master.java
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/security/AuditedSecurityOperation.java
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/security/SecurityConstants.java
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/security/handler/Authenticator.java
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/security/handler/InsecureAuthenticator.java
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/security/handler/ZKAuthenticator.java
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/TabletServer.java
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java
    accumulo/trunk/server/src/test/java/org/apache/accumulo/server/gc/TestConfirmDeletes.java
    accumulo/trunk/server/src/test/java/org/apache/accumulo/server/master/balancer/TableLoadBalancerTest.java
    accumulo/trunk/server/src/test/java/org/apache/accumulo/server/util/CloneTest.java
    accumulo/trunk/server/src/test/java/org/apache/accumulo/server/util/TabletIteratorTest.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/continuous/ContinuousMoru.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/FunctionalTest.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/functional/PermissionsTest.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/performance/scan/CollectTabletStats.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Authenticate.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/ChangePass.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
    accumulo/trunk/test/src/main/java/org/apache/accumulo/test/scalability/ScaleTest.java
    accumulo/trunk/test/src/test/java/org/apache/accumulo/test/iterator/RegExTest.java

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOnDefaultTable.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOnDefaultTable.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOnDefaultTable.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOnDefaultTable.java Mon Jan 28 21:03:43 2013
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.core.cli;
 
+import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.mapreduce.AccumuloInputFormat;
 import org.apache.accumulo.core.client.mapreduce.AccumuloOutputFormat;
 import org.apache.hadoop.mapreduce.Job;
@@ -39,7 +40,7 @@ public class ClientOnDefaultTable extend
   }
   
   @Override
-  public void setAccumuloConfigs(Job job) {
+  public void setAccumuloConfigs(Job job) throws AccumuloSecurityException {
     super.setAccumuloConfigs(job);
     AccumuloInputFormat.setConnectorInfo(job, getAccumuloToken());
     AccumuloInputFormat.setInputTableName(job, getTableName());

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOnRequiredTable.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOnRequiredTable.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOnRequiredTable.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOnRequiredTable.java Mon Jan 28 21:03:43 2013
@@ -16,6 +16,7 @@
  */
 package org.apache.accumulo.core.cli;
 
+import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.mapreduce.AccumuloInputFormat;
 import org.apache.accumulo.core.client.mapreduce.AccumuloOutputFormat;
 import org.apache.hadoop.mapreduce.Job;
@@ -28,7 +29,7 @@ public class ClientOnRequiredTable exten
   public String tableName = null;
   
   @Override
-  public void setAccumuloConfigs(Job job) {
+  public void setAccumuloConfigs(Job job) throws AccumuloSecurityException {
     super.setAccumuloConfigs(job);
     AccumuloInputFormat.setConnectorInfo(job, getAccumuloToken());
     AccumuloInputFormat.setInputTableName(job, tableName);

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java Mon Jan 28 21:03:43 2013
@@ -36,7 +36,7 @@ import org.apache.accumulo.core.conf.Def
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.security.ColumnVisibility;
-import org.apache.accumulo.core.security.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.SecurityToken;
 import org.apache.accumulo.core.security.tokens.InstanceTokenWrapper;
 import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.hadoop.conf.Configuration;
@@ -106,7 +106,7 @@ public class ClientOpts extends Help {
   @Parameter(names = "--password", converter = PasswordConverter.class, description = "Enter the connection password", password = true)
   public Password securePassword = null;
   
-  public AccumuloToken<?,?> getAccumuloToken() {
+  public SecurityToken getAccumuloToken() {
     try {
       String tokenClass = getInstance().getSecurityTokenClass();
       if (tokenClass.equals(UserPassToken.class.getCanonicalName())) {
@@ -219,7 +219,7 @@ public class ClientOpts extends Help {
     return new InstanceTokenWrapper(getAccumuloToken(), getInstance().getInstanceID());
   }
   
-  public void setAccumuloConfigs(Job job) {
+  public void setAccumuloConfigs(Job job) throws AccumuloSecurityException {
     AccumuloInputFormat.setZooKeeperInstance(job, instance, zookeepers);
     AccumuloOutputFormat.setZooKeeperInstance(job, instance, zookeepers);
   }

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/Instance.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/Instance.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/Instance.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/Instance.java Mon Jan 28 21:03:43 2013
@@ -21,7 +21,7 @@ import java.util.List;
 
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.security.thrift.AuthInfo;
-import org.apache.accumulo.core.security.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.SecurityToken;
 import org.apache.accumulo.core.security.tokens.InstanceTokenWrapper;
 
 /**
@@ -97,7 +97,7 @@ public interface Instance {
    *           when a generic exception occurs
    * @throws AccumuloSecurityException
    *           when a user's credentials are invalid
-   * @deprecated @since 1.5, use {@link #getConnector(AccumuloToken)}
+   * @deprecated @since 1.5, use {@link #getConnector(SecurityToken)}
    */
   public abstract Connector getConnector(AuthInfo auth) throws AccumuloException, AccumuloSecurityException;
   
@@ -112,7 +112,7 @@ public interface Instance {
    * @throws AccumuloSecurityException
    *           when a user's credentials are invalid
    */
-  public abstract Connector getConnector(AccumuloToken<?,?> token) throws AccumuloException, AccumuloSecurityException;
+  public abstract Connector getConnector(SecurityToken token) throws AccumuloException, AccumuloSecurityException;
   
   /**
    * Returns a connection to accumulo.
@@ -139,7 +139,7 @@ public interface Instance {
    *           when a generic exception occurs
    * @throws AccumuloSecurityException
    *           when a user's credentials are invalid
-   *           @deprecated @since 1.5, use {@link #getConnector(AccumuloToken)}
+   *           @deprecated @since 1.5, use {@link #getConnector(SecurityToken)}
    */
   public abstract Connector getConnector(String user, ByteBuffer pass) throws AccumuloException, AccumuloSecurityException;
   
@@ -155,7 +155,7 @@ public interface Instance {
    *           when a generic exception occurs
    * @throws AccumuloSecurityException
    *           when a user's credentials are invalid
-   *           @deprecated @since 1.5, use {@link #getConnector(AccumuloToken)}
+   *           @deprecated @since 1.5, use {@link #getConnector(SecurityToken)}
    */
   public abstract Connector getConnector(String user, CharSequence pass) throws AccumuloException, AccumuloSecurityException;
   

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java Mon Jan 28 21:03:43 2013
@@ -31,7 +31,7 @@ import org.apache.accumulo.core.file.Fil
 import org.apache.accumulo.core.master.thrift.MasterClientService.Client;
 import org.apache.accumulo.core.security.thrift.AuthInfo;
 import org.apache.accumulo.core.security.thrift.ThriftSecurityException;
-import org.apache.accumulo.core.security.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.SecurityToken;
 import org.apache.accumulo.core.security.tokens.InstanceTokenWrapper;
 import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.accumulo.core.util.ArgumentChecker;
@@ -211,7 +211,7 @@ public class ZooKeeperInstance implement
   }
   
   /**
-   * @deprecated @since 1.5, use {@link #getConnector(AccumuloToken)}
+   * @deprecated @since 1.5, use {@link #getConnector(SecurityToken)}
    */
   @Override
   public Connector getConnector(String user, CharSequence pass) throws AccumuloException, AccumuloSecurityException {
@@ -219,7 +219,7 @@ public class ZooKeeperInstance implement
   }
   
   /**
-   * @deprecated @since 1.5, use {@link #getConnector(AccumuloToken)}
+   * @deprecated @since 1.5, use {@link #getConnector(SecurityToken)}
    */
   @Override
   public Connector getConnector(String user, ByteBuffer pass) throws AccumuloException, AccumuloSecurityException {
@@ -228,7 +228,7 @@ public class ZooKeeperInstance implement
   
   // Suppress deprecation, ConnectorImpl is deprecated to warn clients against using.
   /**
-   * @deprecated @since 1.5, use {@link #getConnector(AccumuloToken)}
+   * @deprecated @since 1.5, use {@link #getConnector(SecurityToken)}
    */
   @Override
   public Connector getConnector(String user, byte[] pass) throws AccumuloException, AccumuloSecurityException {
@@ -299,7 +299,7 @@ public class ZooKeeperInstance implement
   }
   
   /**
-   * @deprecated @since 1.5, use {@link #getConnector(AccumuloToken)}
+   * @deprecated @since 1.5, use {@link #getConnector(SecurityToken)}
    */
   @Override
   public Connector getConnector(AuthInfo auth) throws AccumuloException, AccumuloSecurityException {
@@ -308,7 +308,7 @@ public class ZooKeeperInstance implement
   
   // Suppress deprecation, ConnectorImpl is deprecated to warn clients against using.
   @Override
-  public Connector getConnector(AccumuloToken<?,?> token) throws AccumuloException, AccumuloSecurityException {
+  public Connector getConnector(SecurityToken token) throws AccumuloException, AccumuloSecurityException {
     return new ConnectorImpl(this, token);
   }
   

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperationsImpl.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperationsImpl.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperationsImpl.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/InstanceOperationsImpl.java Mon Jan 28 21:03:43 2013
@@ -196,6 +196,8 @@ public class InstanceOperationsImpl impl
       throw new AccumuloException(e);
     } catch (TException e) {
       throw new AccumuloException(e);
+    } catch (AccumuloSecurityException e) {
+      throw new AccumuloException(e);
     } finally {
       if (client != null) {
         ThriftUtil.returnClient(client);

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/SecurityOperations.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/SecurityOperations.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/SecurityOperations.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/SecurityOperations.java Mon Jan 28 21:03:43 2013
@@ -23,7 +23,7 @@ import org.apache.accumulo.core.client.A
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.security.SystemPermission;
 import org.apache.accumulo.core.security.TablePermission;
-import org.apache.accumulo.core.security.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.SecurityToken;
 
 /**
  * Provides a class for managing users and permissions
@@ -62,7 +62,7 @@ public interface SecurityOperations {
    * @throws AccumuloSecurityException
    *           if the user does not have permission to create a user
    */
-  public void createUser(AccumuloToken<?,?> token) throws AccumuloException, AccumuloSecurityException;
+  public void createUser(SecurityToken token) throws AccumuloException, AccumuloSecurityException;
   
   /**
    * Delete a user
@@ -88,7 +88,7 @@ public interface SecurityOperations {
    *           if a general error occurs
    * @throws AccumuloSecurityException
    *           if the user does not have permission to ask
-   * @deprecated @since 1.5, use {@link #authenticateUser(AccumuloToken)}
+   * @deprecated @since 1.5, use {@link #authenticateUser(SecurityToken)}
    */
   public boolean authenticateUser(String user, byte[] password) throws AccumuloException, AccumuloSecurityException;
 
@@ -104,7 +104,7 @@ public interface SecurityOperations {
    *           if the user does not have permission to ask
    *  @since 1.5
    */
-  public boolean authenticateUser(AccumuloToken<?,?> token) throws AccumuloException, AccumuloSecurityException;
+  public boolean authenticateUser(SecurityToken token) throws AccumuloException, AccumuloSecurityException;
   
   /**
    * Set the user's password
@@ -117,7 +117,7 @@ public interface SecurityOperations {
    *           if a general error occurs
    * @throws AccumuloSecurityException
    *           if the user does not have permission to modify a user
-   *           @deprecated @since 1.5, use {@link #changeUserPassword(AccumuloToken)}
+   *           @deprecated @since 1.5, use {@link #changeUserPassword(SecurityToken)}
    */
   public void changeUserPassword(String user, byte[] password) throws AccumuloException, AccumuloSecurityException;
   
@@ -133,7 +133,7 @@ public interface SecurityOperations {
    * @throws AccumuloSecurityException
    *           if the user does not have permission to modify a user
    */
-  public void changeUserPassword(AccumuloToken<?,?> newToken) throws AccumuloException, AccumuloSecurityException;
+  public void changeUserPassword(SecurityToken newToken) throws AccumuloException, AccumuloSecurityException;
   
   /**
    * Set the user's record-level authorizations
@@ -266,12 +266,12 @@ public interface SecurityOperations {
   public Set<String> listUsers() throws AccumuloException, AccumuloSecurityException;
 
   /**
-   * @deprecated @since 1.5, use {@link #createUser(AccumuloToken)}
+   * @deprecated @since 1.5, use {@link #createUser(SecurityToken)}
    * @param token
    * @param authorization
    * @throws AccumuloException
    * @throws AccumuloSecurityException
    */
-  void createUser(AccumuloToken<?,?> token, Authorizations authorization) throws AccumuloException, AccumuloSecurityException;
+  void createUser(SecurityToken token, Authorizations authorization) throws AccumuloException, AccumuloSecurityException;
   
 }

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/SecurityOperationsImpl.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/SecurityOperationsImpl.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/SecurityOperationsImpl.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/SecurityOperationsImpl.java Mon Jan 28 21:03:43 2013
@@ -33,7 +33,7 @@ import org.apache.accumulo.core.security
 import org.apache.accumulo.core.security.TablePermission;
 import org.apache.accumulo.core.security.thrift.SecurityErrorCode;
 import org.apache.accumulo.core.security.thrift.ThriftSecurityException;
-import org.apache.accumulo.core.security.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.SecurityToken;
 import org.apache.accumulo.core.security.tokens.InstanceTokenWrapper;
 import org.apache.accumulo.core.security.tokens.PasswordUpdatable;
 import org.apache.accumulo.core.security.tokens.TokenHelper;
@@ -107,7 +107,7 @@ public class SecurityOperationsImpl impl
    *           if a general error occurs
    * @throws AccumuloSecurityException
    *           if the user does not have permission to create a user
-   * @deprecated Use {@link #createUser(AccumuloToken)} instead
+   * @deprecated Use {@link #createUser(SecurityToken)} instead
    */
   @Deprecated
   public void createUser(final String user, final byte[] password, final Authorizations authorizations) throws AccumuloException, AccumuloSecurityException {
@@ -128,9 +128,9 @@ public class SecurityOperationsImpl impl
    *           if a general error occurs
    * @throws AccumuloSecurityException
    *           if the user does not have permission to create a user
-   * @deprecated Use {@link #createUser(AccumuloToken)} instead
+   * @deprecated Use {@link #createUser(SecurityToken)} instead
    */
-  public void createUser(final AccumuloToken<?,?> newToken, final Authorizations authorizations) throws AccumuloException, AccumuloSecurityException {
+  public void createUser(final SecurityToken newToken, final Authorizations authorizations) throws AccumuloException, AccumuloSecurityException {
     ArgumentChecker.notNull(newToken, authorizations);
     execute(new ClientExec<ClientService.Client>() {
       @Override
@@ -153,7 +153,7 @@ public class SecurityOperationsImpl impl
    * @throws AccumuloSecurityException
    *           if the user does not have permission to create a user
    */
-  public void createUser(final AccumuloToken<?,?> newToken) throws AccumuloException, AccumuloSecurityException {
+  public void createUser(final SecurityToken newToken) throws AccumuloException, AccumuloSecurityException {
     createUser(newToken, new Authorizations());
   }
   
@@ -189,7 +189,7 @@ public class SecurityOperationsImpl impl
    *           if a general error occurs
    * @throws AccumuloSecurityException
    *           if the user does not have permission to ask
-   * @deprecated since 1.5, use {@link #authenticateUser(AccumuloToken)}
+   * @deprecated since 1.5, use {@link #authenticateUser(SecurityToken)}
    */
   public boolean authenticateUser(final String user, final byte[] password) throws AccumuloException, AccumuloSecurityException {
     ArgumentChecker.notNull(user, password);
@@ -207,7 +207,7 @@ public class SecurityOperationsImpl impl
    * @throws AccumuloSecurityException
    *           if the user does not have permission to ask
    */
-  public boolean authenticateUser(final AccumuloToken<?,?> token2) throws AccumuloException, AccumuloSecurityException {
+  public boolean authenticateUser(final SecurityToken token2) throws AccumuloException, AccumuloSecurityException {
     ArgumentChecker.notNull(token2);
     return execute(new ClientExecReturn<Boolean,ClientService.Client>() {
       @Override
@@ -229,7 +229,7 @@ public class SecurityOperationsImpl impl
    * @throws AccumuloSecurityException
    *           if the user does not have permission to modify a user
    */
-  public void changeUserPassword(final AccumuloToken<?,?> newToken) throws AccumuloException, AccumuloSecurityException {
+  public void changeUserPassword(final SecurityToken newToken) throws AccumuloException, AccumuloSecurityException {
     ArgumentChecker.notNull(newToken);
     execute(new ClientExec<ClientService.Client>() {
       @Override

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java Mon Jan 28 21:03:43 2013
@@ -210,6 +210,8 @@ public class TableOperationsImpl extends
       } catch (TTransportException tte) {
         log.debug("Failed to call beginTableOperation(), retrying ... ", tte);
         UtilWaitThread.sleep(100);
+      } catch (AccumuloSecurityException e) {
+        throw e.asThriftException();
       } finally {
         MasterClient.close(client);
       }
@@ -227,6 +229,8 @@ public class TableOperationsImpl extends
       } catch (TTransportException tte) {
         log.debug("Failed to call executeTableOperation(), retrying ... ", tte);
         UtilWaitThread.sleep(100);
+      } catch (AccumuloSecurityException e) {
+        throw e.asThriftException();
       } finally {
         MasterClient.close(client);
       }
@@ -242,6 +246,8 @@ public class TableOperationsImpl extends
       } catch (TTransportException tte) {
         log.debug("Failed to call waitForTableOperation(), retrying ... ", tte);
         UtilWaitThread.sleep(100);
+      } catch (AccumuloSecurityException e) {
+        throw e.asThriftException();
       } finally {
         MasterClient.close(client);
       }
@@ -258,6 +264,8 @@ public class TableOperationsImpl extends
       } catch (TTransportException tte) {
         log.debug("Failed to call finishTableOperation(), retrying ... ", tte);
         UtilWaitThread.sleep(100);
+      } catch (AccumuloSecurityException e) {
+        throw e.asThriftException();
       } finally {
         MasterClient.close(client);
       }

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/ConnectorImpl.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/ConnectorImpl.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/ConnectorImpl.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/ConnectorImpl.java Mon Jan 28 21:03:43 2013
@@ -40,7 +40,7 @@ import org.apache.accumulo.core.client.a
 import org.apache.accumulo.core.client.impl.thrift.ClientService;
 import org.apache.accumulo.core.master.state.tables.TableState;
 import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.security.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.SecurityToken;
 import org.apache.accumulo.core.security.tokens.InstanceTokenWrapper;
 import org.apache.accumulo.core.util.ArgumentChecker;
 
@@ -66,7 +66,7 @@ public class ConnectorImpl extends Conne
    * @deprecated Not for client use
    */
   @Deprecated
-  public ConnectorImpl(Instance instance, final AccumuloToken<?,?> token2) throws AccumuloException, AccumuloSecurityException {
+  public ConnectorImpl(Instance instance, final SecurityToken token2) throws AccumuloException, AccumuloSecurityException {
     ArgumentChecker.notNull(instance, token2);
     this.instance = instance;
     

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java Mon Jan 28 21:03:43 2013
@@ -55,7 +55,7 @@ import org.apache.accumulo.core.iterator
 import org.apache.accumulo.core.master.state.tables.TableState;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.security.ColumnVisibility;
-import org.apache.accumulo.core.security.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.SecurityToken;
 import org.apache.accumulo.core.util.ArgumentChecker;
 import org.apache.accumulo.core.util.CachedConfiguration;
 import org.apache.accumulo.core.util.LocalityGroupUtil;
@@ -121,7 +121,7 @@ class OfflineIterator implements Iterato
    * @param authorizations
    * @param table
    */
-  public OfflineIterator(ScannerOptions options, Instance instance, AccumuloToken<?,?> credentials, Authorizations authorizations, Text table, Range range) {
+  public OfflineIterator(ScannerOptions options, Instance instance, SecurityToken credentials, Authorizations authorizations, Text table, Range range) {
     this.options = new ScannerOptions(options);
     this.instance = instance;
     this.range = range;
@@ -343,11 +343,11 @@ public class OfflineScanner extends Scan
   private Range range;
   
   private Instance instance;
-  private AccumuloToken<?,?> credentials;
+  private SecurityToken credentials;
   private Authorizations authorizations;
   private Text tableId;
   
-  public OfflineScanner(Instance instance, AccumuloToken<?,?> credentials, String tableId, Authorizations authorizations) {
+  public OfflineScanner(Instance instance, SecurityToken credentials, String tableId, Authorizations authorizations) {
     ArgumentChecker.notNull(instance, credentials, tableId, authorizations);
     this.instance = instance;
     this.credentials = credentials;

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocator.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocator.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocator.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/TabletLocator.java Mon Jan 28 21:03:43 2013
@@ -32,7 +32,7 @@ import org.apache.accumulo.core.client.T
 import org.apache.accumulo.core.data.KeyExtent;
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.Range;
-import org.apache.accumulo.core.security.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.SecurityToken;
 import org.apache.accumulo.core.security.tokens.InstanceTokenWrapper;
 import org.apache.accumulo.core.util.ArgumentChecker;
 import org.apache.hadoop.io.Text;
@@ -93,7 +93,7 @@ public abstract class TabletLocator {
   
   private static final Text ROOT_TABLET_MDE = KeyExtent.getMetadataEntry(new Text(Constants.METADATA_TABLE_ID), null);
   
-  public static synchronized TabletLocator getInstance(Instance instance, AccumuloToken<?,?> credentials, Text tableId) {
+  public static synchronized TabletLocator getInstance(Instance instance, SecurityToken credentials, Text tableId) {
     return getInstance(instance, new InstanceTokenWrapper(credentials, instance.getInstanceID()), tableId);
   }
   

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloInputFormat.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloInputFormat.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloInputFormat.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloInputFormat.java Mon Jan 28 21:03:43 2013
@@ -22,7 +22,7 @@ import java.util.Map.Entry;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.security.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.SecurityToken;
 import org.apache.accumulo.core.util.format.DefaultFormatter;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.mapred.InputFormat;
@@ -38,7 +38,7 @@ import org.apache.hadoop.mapred.Reporter
  * The user must specify the following via static configurator methods:
  * 
  * <ul>
- * <li>{@link AccumuloInputFormat#setConnectorInfo(JobConf, AccumuloToken)} OR {@link AccumuloInputFormat#setConnectorInfo(JobConf, Path)}
+ * <li>{@link AccumuloInputFormat#setConnectorInfo(JobConf, SecurityToken)} OR {@link AccumuloInputFormat#setConnectorInfo(JobConf, Path)}
  * <li>{@link AccumuloInputFormat#setInputTableName(JobConf, String)}
  * <li>{@link AccumuloInputFormat#setScanAuthorizations(JobConf, Authorizations)}
  * <li>{@link AccumuloInputFormat#setZooKeeperInstance(JobConf, String, String)} OR {@link AccumuloInputFormat#setMockInstance(JobConf, String)}

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloOutputFormat.java Mon Jan 28 21:03:43 2013
@@ -40,7 +40,7 @@ import org.apache.accumulo.core.data.Key
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.security.ColumnVisibility;
 import org.apache.accumulo.core.security.thrift.SecurityErrorCode;
-import org.apache.accumulo.core.security.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.SecurityToken;
 import org.apache.accumulo.core.security.tokens.TokenHelper;
 import org.apache.hadoop.filecache.DistributedCache;
 import org.apache.hadoop.fs.FileSystem;
@@ -61,7 +61,7 @@ import org.apache.log4j.Logger;
  * The user must specify the following via static configurator methods:
  * 
  * <ul>
- * <li>{@link AccumuloOutputFormat#setConnectorInfo(JobConf, AccumuloToken)} OR {@link AccumuloOutputFormat#setConnectorInfo(JobConf, Path)}
+ * <li>{@link AccumuloOutputFormat#setConnectorInfo(JobConf, SecurityToken)} OR {@link AccumuloOutputFormat#setConnectorInfo(JobConf, Path)}
  * <li>{@link AccumuloOutputFormat#setZooKeeperInstance(JobConf, String, String)} OR {@link AccumuloOutputFormat#setMockInstance(JobConf, String)}
  * </ul>
  * 
@@ -83,9 +83,10 @@ public class AccumuloOutputFormat implem
    *          the Hadoop job instance to be configured
    * @param token
    *          a valid AccumuloToken (principal must have Table.CREATE permission)
+   * @throws AccumuloSecurityException 
    * @since 1.5.0
    */
-  public static void setConnectorInfo(JobConf job, AccumuloToken<?,?> token) {
+  public static void setConnectorInfo(JobConf job, SecurityToken token) throws AccumuloSecurityException {
     OutputConfigurator.setConnectorInfo(CLASS, job, token);
   }
   
@@ -93,12 +94,12 @@ public class AccumuloOutputFormat implem
    * Sets the connector information needed to communicate with Accumulo in this job. The authentication information will be read from the specified file when
    * the job runs. This prevents the user's token from being exposed on the Job Tracker web page. The specified path will be placed in the
    * {@link DistributedCache}, for better performance during job execution. Users can create the contents of this file using
-   * {@link TokenHelper#asBase64String(AccumuloToken)}.
+   * {@link TokenHelper#asBase64String(SecurityToken)}.
    * 
    * @param job
    *          the Hadoop job instance to be configured
    * @param path
-   *          the path to a file in the configured file system, containing the serialized, base-64 encoded {@link AccumuloToken} with the user's authentication
+   *          the path to a file in the configured file system, containing the serialized, base-64 encoded {@link SecurityToken} with the user's authentication
    * @since 1.5.0
    */
   public static void setConnectorInfo(JobConf job, Path path) {
@@ -112,7 +113,7 @@ public class AccumuloOutputFormat implem
    *          the Hadoop context for the configured job
    * @return true if the connector has been configured, false otherwise
    * @since 1.5.0
-   * @see #setConnectorInfo(JobConf, AccumuloToken)
+   * @see #setConnectorInfo(JobConf, SecurityToken)
    * @see #setConnectorInfo(JobConf, Path)
    */
   protected static Boolean isConnectorInfoSet(JobConf job) {
@@ -126,11 +127,12 @@ public class AccumuloOutputFormat implem
    * @param job
    *          the Hadoop context for the configured job
    * @return the decoded user token
+   * @throws AccumuloSecurityException 
    * @since 1.5.0
-   * @see #setConnectorInfo(JobConf, AccumuloToken)
+   * @see #setConnectorInfo(JobConf, SecurityToken)
    * @see #setConnectorInfo(JobConf, Path)
    */
-  protected static AccumuloToken<?,?> getToken(JobConf job) {
+  protected static SecurityToken getToken(JobConf job) throws AccumuloSecurityException {
     return OutputConfigurator.getToken(CLASS, job);
   }
   

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloRowInputFormat.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloRowInputFormat.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloRowInputFormat.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/AccumuloRowInputFormat.java Mon Jan 28 21:03:43 2013
@@ -23,7 +23,7 @@ import org.apache.accumulo.core.client.R
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.security.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.SecurityToken;
 import org.apache.accumulo.core.util.PeekingIterator;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.Text;
@@ -40,7 +40,7 @@ import org.apache.hadoop.mapred.Reporter
  * The user must specify the following via static configurator methods:
  * 
  * <ul>
- * <li>{@link AccumuloRowInputFormat#setConnectorInfo(JobConf, AccumuloToken)} OR {@link AccumuloRowInputFormat#setConnectorInfo(JobConf, Path)}
+ * <li>{@link AccumuloRowInputFormat#setConnectorInfo(JobConf, SecurityToken)} OR {@link AccumuloRowInputFormat#setConnectorInfo(JobConf, Path)}
  * <li>{@link AccumuloRowInputFormat#setInputTableName(JobConf, String)}
  * <li>{@link AccumuloRowInputFormat#setScanAuthorizations(JobConf, Authorizations)}
  * <li>{@link AccumuloRowInputFormat#setZooKeeperInstance(JobConf, String, String)} OR {@link AccumuloRowInputFormat#setMockInstance(JobConf, String)}

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/InputFormatBase.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/InputFormatBase.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/InputFormatBase.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapred/InputFormatBase.java Mon Jan 28 21:03:43 2013
@@ -53,7 +53,7 @@ import org.apache.accumulo.core.data.Ran
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.master.state.tables.TableState;
 import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.security.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.SecurityToken;
 import org.apache.accumulo.core.security.tokens.TokenHelper;
 import org.apache.accumulo.core.util.Pair;
 import org.apache.accumulo.core.util.UtilWaitThread;
@@ -94,9 +94,10 @@ public abstract class InputFormatBase<K,
    *          the Hadoop job instance to be configured
    * @param token
    *          a valid AccumuloToken (principal must have Table.CREATE permission)
+   * @throws AccumuloSecurityException
    * @since 1.5.0
    */
-  public static void setConnectorInfo(JobConf job, AccumuloToken<?,?> token) {
+  public static void setConnectorInfo(JobConf job, SecurityToken token) throws AccumuloSecurityException {
     InputConfigurator.setConnectorInfo(CLASS, job, token);
   }
   
@@ -104,12 +105,12 @@ public abstract class InputFormatBase<K,
    * Sets the connector information needed to communicate with Accumulo in this job. The authentication information will be read from the specified file when
    * the job runs. This prevents the user's token from being exposed on the Job Tracker web page. The specified path will be placed in the
    * {@link DistributedCache}, for better performance during job execution. Users can create the contents of this file using
-   * {@link TokenHelper#asBase64String(AccumuloToken)}.
+   * {@link TokenHelper#asBase64String(SecurityToken)}.
    * 
    * @param job
    *          the Hadoop job instance to be configured
    * @param path
-   *          the path to a file in the configured file system, containing the serialized, base-64 encoded {@link AccumuloToken} with the user's authentication
+   *          the path to a file in the configured file system, containing the serialized, base-64 encoded {@link SecurityToken} with the user's authentication
    * @since 1.5.0
    */
   public static void setConnectorInfo(JobConf job, Path path) {
@@ -123,7 +124,7 @@ public abstract class InputFormatBase<K,
    *          the Hadoop context for the configured job
    * @return true if the connector has been configured, false otherwise
    * @since 1.5.0
-   * @see #setConnectorInfo(JobConf, AccumuloToken)
+   * @see #setConnectorInfo(JobConf, SecurityToken)
    * @see #setConnectorInfo(JobConf, Path)
    */
   protected static Boolean isConnectorInfoSet(JobConf job) {
@@ -137,11 +138,12 @@ public abstract class InputFormatBase<K,
    * @param job
    *          the Hadoop context for the configured job
    * @return the decoded user Token
+   * @throws AccumuloSecurityException
    * @since 1.5.0
-   * @see #setConnectorInfo(JobConf, AccumuloToken)
+   * @see #setConnectorInfo(JobConf, SecurityToken)
    * @see #setConnectorInfo(JobConf, Path)
    */
-  protected static AccumuloToken<?,?> getToken(JobConf job) {
+  protected static SecurityToken getToken(JobConf job) throws AccumuloSecurityException {
     return InputConfigurator.getToken(CLASS, job);
   }
   
@@ -492,9 +494,10 @@ public abstract class InputFormatBase<K,
    * @return an Accumulo tablet locator
    * @throws TableNotFoundException
    *           if the table name set on the configuration doesn't exist
+   * @throws AccumuloSecurityException 
    * @since 1.5.0
    */
-  protected static TabletLocator getTabletLocator(JobConf job) throws TableNotFoundException {
+  protected static TabletLocator getTabletLocator(JobConf job) throws TableNotFoundException, AccumuloSecurityException {
     return InputConfigurator.getTabletLocator(CLASS, job);
   }
   
@@ -550,10 +553,10 @@ public abstract class InputFormatBase<K,
       split = (RangeInputSplit) inSplit;
       log.debug("Initializing input split: " + split.getRange());
       Instance instance = getInstance(job);
-      AccumuloToken<?,?> token = getToken(job);
       Authorizations authorizations = getScanAuthorizations(job);
       
       try {
+        SecurityToken token = getToken(job);
         log.debug("Creating connector with user: " + token.getPrincipal());
         Connector conn = instance.getConnector(token);
         log.debug("Creating scanner for table: " + getInputTableName(job));

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormat.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormat.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormat.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormat.java Mon Jan 28 21:03:43 2013
@@ -22,7 +22,7 @@ import java.util.Map.Entry;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.security.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.SecurityToken;
 import org.apache.accumulo.core.util.format.DefaultFormatter;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.mapreduce.InputFormat;
@@ -38,7 +38,7 @@ import org.apache.hadoop.mapreduce.TaskA
  * The user must specify the following via static configurator methods:
  * 
  * <ul>
- * <li>{@link AccumuloInputFormat#setConnectorInfo(Job, AccumuloToken)} OR {@link AccumuloInputFormat#setConnectorInfo(Job, Path)}
+ * <li>{@link AccumuloInputFormat#setConnectorInfo(Job, SecurityToken)} OR {@link AccumuloInputFormat#setConnectorInfo(Job, Path)}
  * <li>{@link AccumuloInputFormat#setInputTableName(Job, String)}
  * <li>{@link AccumuloInputFormat#setScanAuthorizations(Job, Authorizations)}
  * <li>{@link AccumuloInputFormat#setZooKeeperInstance(Job, String, String)} OR {@link AccumuloInputFormat#setMockInstance(Job, String)}

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormat.java Mon Jan 28 21:03:43 2013
@@ -41,7 +41,7 @@ import org.apache.accumulo.core.data.Key
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.security.ColumnVisibility;
 import org.apache.accumulo.core.security.thrift.SecurityErrorCode;
-import org.apache.accumulo.core.security.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.SecurityToken;
 import org.apache.accumulo.core.security.tokens.TokenHelper;
 import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.hadoop.conf.Configuration;
@@ -65,7 +65,7 @@ import org.apache.log4j.Logger;
  * The user must specify the following via static configurator methods:
  * 
  * <ul>
- * <li>{@link AccumuloOutputFormat#setConnectorInfo(Job, AccumuloToken)} OR {@link AccumuloOutputFormat#setConnectorInfo(Job, Path)}
+ * <li>{@link AccumuloOutputFormat#setConnectorInfo(Job, SecurityToken)} OR {@link AccumuloOutputFormat#setConnectorInfo(Job, Path)}
  * <li>{@link AccumuloOutputFormat#setZooKeeperInstance(Job, String, String)} OR {@link AccumuloOutputFormat#setMockInstance(Job, String)}
  * </ul>
  * 
@@ -87,9 +87,10 @@ public class AccumuloOutputFormat extend
    *          the Hadoop job instance to be configured
    * @param token
    *          a valid AccumuloToken (principal must have Table.CREATE permission)
+   * @throws AccumuloSecurityException 
    * @since 1.5.0
    */
-  public static void setConnectorInfo(Job job, AccumuloToken<?,?> token) {
+  public static void setConnectorInfo(Job job, SecurityToken token) throws AccumuloSecurityException {
     OutputConfigurator.setConnectorInfo(CLASS, job.getConfiguration(), token);
   }
   
@@ -97,12 +98,12 @@ public class AccumuloOutputFormat extend
    * Sets the connector information needed to communicate with Accumulo in this job. The authentication information will be read from the specified file when
    * the job runs. This prevents the user's token from being exposed on the Job Tracker web page. The specified path will be placed in the
    * {@link DistributedCache}, for better performance during job execution. Users can create the contents of this file using
-   * {@link TokenHelper#asBase64String(AccumuloToken)}.
+   * {@link TokenHelper#asBase64String(SecurityToken)}.
    * 
    * @param job
    *          the Hadoop job instance to be configured
    * @param path
-   *          the path to a file in the configured file system, containing the serialized, base-64 encoded {@link AccumuloToken} with the user's authentication
+   *          the path to a file in the configured file system, containing the serialized, base-64 encoded {@link SecurityToken} with the user's authentication
    * @since 1.5.0
    */
   public static void setConnectorInfo(Job job, Path path) {
@@ -116,7 +117,7 @@ public class AccumuloOutputFormat extend
    *          the Hadoop context for the configured job
    * @return true if the connector has been configured, false otherwise
    * @since 1.5.0
-   * @see #setConnectorInfo(Job, AccumuloToken)
+   * @see #setConnectorInfo(Job, SecurityToken)
    * @see #setConnectorInfo(Job, Path)
    */
   protected static Boolean isConnectorInfoSet(JobContext context) {
@@ -129,11 +130,12 @@ public class AccumuloOutputFormat extend
    * @param context
    *          the Hadoop context for the configured job
    * @return the AccumuloToken
+   * @throws AccumuloSecurityException 
    * @since 1.5.0
-   * @see #setConnectorInfo(Job, AccumuloToken)
+   * @see #setConnectorInfo(Job, SecurityToken)
    * @see #setConnectorInfo(Job, Path)
    */
-  protected static AccumuloToken<?,?> getToken(JobContext context) {
+  protected static SecurityToken getToken(JobContext context) throws AccumuloSecurityException {
     return OutputConfigurator.getToken(CLASS, context.getConfiguration());
   }
   
@@ -512,12 +514,16 @@ public class AccumuloOutputFormat extend
   // ----------------------------------------------------------------------------------------------------
   
   /**
-   * @deprecated since 1.5.0; Use {@link #setConnectorInfo(Job, AccumuloToken)}, {@link #setConnectorInfo(Job, Path)}, {@link #setCreateTables(Job, boolean)},
+   * @deprecated since 1.5.0; Use {@link #setConnectorInfo(Job, SecurityToken)}, {@link #setConnectorInfo(Job, Path)}, {@link #setCreateTables(Job, boolean)},
    *             and {@link #setDefaultTableName(Job, String)} instead.
    */
   @Deprecated
   public static void setOutputInfo(Configuration conf, String user, byte[] passwd, boolean createTables, String defaultTable) {
-    OutputConfigurator.setConnectorInfo(CLASS, conf, new UserPassToken(user, passwd));
+    try {
+      OutputConfigurator.setConnectorInfo(CLASS, conf, new UserPassToken(user, passwd));
+    } catch (AccumuloSecurityException e) {
+      throw new RuntimeException(e);
+    }
     OutputConfigurator.setCreateTables(CLASS, conf, createTables);
     OutputConfigurator.setDefaultTableName(CLASS, conf, defaultTable);
   }
@@ -589,7 +595,11 @@ public class AccumuloOutputFormat extend
    */
   @Deprecated
   protected static String getUsername(Configuration conf) {
-    return OutputConfigurator.getToken(CLASS, conf).getPrincipal();
+    try {
+      return OutputConfigurator.getToken(CLASS, conf).getPrincipal();
+    } catch (AccumuloSecurityException e) {
+      throw new RuntimeException(e);
+    }
   }
   
   /**
@@ -597,7 +607,12 @@ public class AccumuloOutputFormat extend
    */
   @Deprecated
   protected static byte[] getPassword(Configuration conf) {
-    AccumuloToken<?,?> token = OutputConfigurator.getToken(CLASS, conf);
+    SecurityToken token;
+    try {
+      token = OutputConfigurator.getToken(CLASS, conf);
+    } catch (AccumuloSecurityException e) {
+      throw new RuntimeException(e);
+    }
     if (token instanceof UserPassToken) {
       UserPassToken upt = (UserPassToken) token;
       return upt.getPassword();

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloRowInputFormat.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloRowInputFormat.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloRowInputFormat.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AccumuloRowInputFormat.java Mon Jan 28 21:03:43 2013
@@ -23,7 +23,7 @@ import org.apache.accumulo.core.client.R
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.security.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.SecurityToken;
 import org.apache.accumulo.core.util.PeekingIterator;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.Text;
@@ -40,7 +40,7 @@ import org.apache.hadoop.mapreduce.TaskA
  * The user must specify the following via static configurator methods:
  * 
  * <ul>
- * <li>{@link AccumuloRowInputFormat#setConnectorInfo(Job, AccumuloToken)} OR {@link AccumuloRowInputFormat#setConnectorInfo(Job, Path)}
+ * <li>{@link AccumuloRowInputFormat#setConnectorInfo(Job, SecurityToken)} OR {@link AccumuloRowInputFormat#setConnectorInfo(Job, Path)}
  * <li>{@link AccumuloRowInputFormat#setInputTableName(Job, String)}
  * <li>{@link AccumuloRowInputFormat#setScanAuthorizations(Job, Authorizations)}
  * <li>{@link AccumuloRowInputFormat#setZooKeeperInstance(Job, String, String)} OR {@link AccumuloRowInputFormat#setMockInstance(Job, String)}

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java Mon Jan 28 21:03:43 2013
@@ -62,7 +62,7 @@ import org.apache.accumulo.core.data.Val
 import org.apache.accumulo.core.iterators.user.VersioningIterator;
 import org.apache.accumulo.core.master.state.tables.TableState;
 import org.apache.accumulo.core.security.Authorizations;
-import org.apache.accumulo.core.security.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.SecurityToken;
 import org.apache.accumulo.core.security.tokens.TokenHelper;
 import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.accumulo.core.util.Pair;
@@ -107,9 +107,10 @@ public abstract class InputFormatBase<K,
    *          the Hadoop job instance to be configured
    * @param token
    *          a valid AccumuloToken (principal must have Table.CREATE permission)
+   * @throws AccumuloSecurityException
    * @since 1.5.0
    */
-  public static void setConnectorInfo(Job job, AccumuloToken<?,?> token) {
+  public static void setConnectorInfo(Job job, SecurityToken token) throws AccumuloSecurityException {
     InputConfigurator.setConnectorInfo(CLASS, job.getConfiguration(), token);
   }
   
@@ -117,12 +118,12 @@ public abstract class InputFormatBase<K,
    * Sets the connector information needed to communicate with Accumulo in this job. The authentication information will be read from the specified file when
    * the job runs. This prevents the user's token from being exposed on the Job Tracker web page. The specified path will be placed in the
    * {@link DistributedCache}, for better performance during job execution. Users can create the contents of this file using
-   * {@link TokenHelper#asBase64String(AccumuloToken)}.
+   * {@link TokenHelper#asBase64String(SecurityToken)}.
    * 
    * @param job
    *          the Hadoop job instance to be configured
    * @param path
-   *          the path to a file in the configured file system, containing the serialized, base-64 encoded {@link AccumuloToken} with the user's authentication
+   *          the path to a file in the configured file system, containing the serialized, base-64 encoded {@link SecurityToken} with the user's authentication
    * @since 1.5.0
    */
   public static void setConnectorInfo(Job job, Path path) {
@@ -136,7 +137,7 @@ public abstract class InputFormatBase<K,
    *          the Hadoop context for the configured job
    * @return true if the connector has been configured, false otherwise
    * @since 1.5.0
-   * @see #setConnectorInfo(Job, AccumuloToken)
+   * @see #setConnectorInfo(Job, SecurityToken)
    * @see #setConnectorInfo(Job, Path)
    */
   protected static Boolean isConnectorInfoSet(JobContext context) {
@@ -149,11 +150,12 @@ public abstract class InputFormatBase<K,
    * @param context
    *          the Hadoop context for the configured job
    * @return the user name
+   * @throws AccumuloSecurityException
    * @since 1.5.0
-   * @see #setConnectorInfo(Job, AccumuloToken)
+   * @see #setConnectorInfo(Job, SecurityToken)
    * @see #setConnectorInfo(Job, Path)
    */
-  protected static AccumuloToken<?,?> getToken(JobContext context) {
+  protected static SecurityToken getToken(JobContext context) throws AccumuloSecurityException {
     return InputConfigurator.getToken(CLASS, context.getConfiguration());
   }
   
@@ -504,9 +506,10 @@ public abstract class InputFormatBase<K,
    * @return an Accumulo tablet locator
    * @throws TableNotFoundException
    *           if the table name set on the configuration doesn't exist
+   * @throws AccumuloSecurityException 
    * @since 1.5.0
    */
-  protected static TabletLocator getTabletLocator(JobContext context) throws TableNotFoundException {
+  protected static TabletLocator getTabletLocator(JobContext context) throws TableNotFoundException, AccumuloSecurityException {
     return InputConfigurator.getTabletLocator(CLASS, context.getConfiguration());
   }
   
@@ -565,10 +568,10 @@ public abstract class InputFormatBase<K,
       split = (RangeInputSplit) inSplit;
       log.debug("Initializing input split: " + split.range);
       Instance instance = getInstance(attempt);
-      AccumuloToken<?,?> token = getToken(attempt);
       Authorizations authorizations = getScanAuthorizations(attempt);
       
       try {
+        SecurityToken token = getToken(attempt);
         log.debug("Creating connector with user: " + token.getPrincipal());
         Connector conn = instance.getConnector(token);
         log.debug("Creating scanner for table: " + getInputTableName(attempt));
@@ -970,12 +973,16 @@ public abstract class InputFormatBase<K,
   }
   
   /**
-   * @deprecated since 1.5.0; Use {@link #setConnectorInfo(Job, AccumuloToken)}, {@link #setInputTableName(Job, String)}, and
+   * @deprecated since 1.5.0; Use {@link #setConnectorInfo(Job, SecurityToken)}, {@link #setInputTableName(Job, String)}, and
    *             {@link #setScanAuthorizations(Job, Authorizations)} instead.
    */
   @Deprecated
   public static void setInputInfo(Configuration conf, String user, byte[] passwd, String table, Authorizations auths) {
-    InputConfigurator.setConnectorInfo(CLASS, conf, new UserPassToken(user, passwd));
+    try {
+      InputConfigurator.setConnectorInfo(CLASS, conf, new UserPassToken(user, passwd));
+    } catch (AccumuloSecurityException e) {
+      throw new RuntimeException(e);
+    }
     InputConfigurator.setInputTableName(CLASS, conf, table);
     InputConfigurator.setScanAuthorizations(CLASS, conf, auths);
   }
@@ -1075,7 +1082,11 @@ public abstract class InputFormatBase<K,
    */
   @Deprecated
   protected static String getUsername(Configuration conf) {
-    return InputConfigurator.getToken(CLASS, conf).getPrincipal();
+    try {
+      return InputConfigurator.getToken(CLASS, conf).getPrincipal();
+    } catch (AccumuloSecurityException e) {
+      throw new RuntimeException(e);
+    }
   }
   
   /**
@@ -1083,7 +1094,12 @@ public abstract class InputFormatBase<K,
    */
   @Deprecated
   protected static byte[] getPassword(Configuration conf) {
-    AccumuloToken<?,?> token = InputConfigurator.getToken(CLASS, conf);
+    SecurityToken token;
+    try {
+      token = InputConfigurator.getToken(CLASS, conf);
+    } catch (AccumuloSecurityException e) {
+      throw new RuntimeException(e);
+    }
     if (token instanceof UserPassToken) {
       UserPassToken upt = (UserPassToken) token;
       return upt.getPassword();
@@ -1120,7 +1136,11 @@ public abstract class InputFormatBase<K,
    */
   @Deprecated
   protected static TabletLocator getTabletLocator(Configuration conf) throws TableNotFoundException {
-    return InputConfigurator.getTabletLocator(CLASS, conf);
+    try {
+      return InputConfigurator.getTabletLocator(CLASS, conf);
+    } catch (AccumuloSecurityException e) {
+      throw new RuntimeException(e);
+    }
   }
   
   /**

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/util/ConfiguratorBase.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/util/ConfiguratorBase.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/util/ConfiguratorBase.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/util/ConfiguratorBase.java Mon Jan 28 21:03:43 2013
@@ -23,10 +23,11 @@ import java.io.IOException;
 import java.net.URI;
 import java.util.Scanner;
 
+import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.Instance;
 import org.apache.accumulo.core.client.ZooKeeperInstance;
 import org.apache.accumulo.core.client.mock.MockInstance;
-import org.apache.accumulo.core.security.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.SecurityToken;
 import org.apache.accumulo.core.security.tokens.TokenHelper;
 import org.apache.accumulo.core.util.ArgumentChecker;
 import org.apache.hadoop.conf.Configuration;
@@ -95,9 +96,10 @@ public class ConfiguratorBase {
    *          the Hadoop configuration object to configure
    * @param token
    *          a valid AccumuloToken
+   * @throws AccumuloSecurityException 
    * @since 1.5.0
    */
-  public static void setConnectorInfo(Class<?> implementingClass, Configuration conf, AccumuloToken<?,?> token) {
+  public static void setConnectorInfo(Class<?> implementingClass, Configuration conf, SecurityToken token) throws AccumuloSecurityException {
     if (isConnectorInfoSet(implementingClass, conf))
       throw new IllegalStateException("Connector info for " + implementingClass.getSimpleName() + " can only be set once per job");
     
@@ -111,14 +113,14 @@ public class ConfiguratorBase {
    * Sets the connector information needed to communicate with Accumulo in this job. The authentication information will be read from the specified file when
    * the job runs. This prevents the user's token from being exposed on the Job Tracker web page. The specified path will be placed in the
    * {@link DistributedCache}, for better performance during job execution. Users can create the contents of this file using
-   * {@link TokenHelper#asBase64String(AccumuloToken)}.
+   * {@link TokenHelper#asBase64String(SecurityToken)}.
    * 
    * @param implementingClass
    *          the class whose name will be used as a prefix for the property configuration key
    * @param conf
    *          the Hadoop configuration object to configure
    * @param path
-   *          the path to a file in the configured file system, containing the serialized, base-64 encoded {@link AccumuloToken} with the user's authentication
+   *          the path to a file in the configured file system, containing the serialized, base-64 encoded {@link SecurityToken} with the user's authentication
    * @since 1.5.0
    */
   public static void setConnectorInfo(Class<?> implementingClass, Configuration conf, Path path) {
@@ -142,7 +144,7 @@ public class ConfiguratorBase {
    *          the Hadoop configuration object to configure
    * @return true if the connector info has already been set, false otherwise
    * @since 1.5.0
-   * @see #setConnectorInfo(Class, Configuration, AccumuloToken)
+   * @see #setConnectorInfo(Class, Configuration, SecurityToken)
    * @see #setConnectorInfo(Class, Configuration, Path)
    */
   public static Boolean isConnectorInfoSet(Class<?> implementingClass, Configuration conf) {
@@ -157,11 +159,12 @@ public class ConfiguratorBase {
    * @param conf
    *          the Hadoop configuration object to configure
    * @return the AccumuloToken
+   * @throws AccumuloSecurityException 
    * @since 1.5.0
-   * @see #setConnectorInfo(Class, Configuration, AccumuloToken)
+   * @see #setConnectorInfo(Class, Configuration, SecurityToken)
    * @see #setConnectorInfo(Class, Configuration, Path)
    */
-  public static AccumuloToken<?,?> getToken(Class<?> implementingClass, Configuration conf) {
+  public static SecurityToken getToken(Class<?> implementingClass, Configuration conf) throws AccumuloSecurityException {
     if (!isConnectorInfoSet(implementingClass, conf))
       throw new IllegalStateException("Connector info for " + implementingClass.getSimpleName() + " has not been set");
     

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/util/InputConfigurator.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/util/InputConfigurator.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/util/InputConfigurator.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/util/InputConfigurator.java Mon Jan 28 21:03:43 2013
@@ -46,7 +46,7 @@ import org.apache.accumulo.core.data.Ran
 import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.security.TablePermission;
-import org.apache.accumulo.core.security.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.SecurityToken;
 import org.apache.accumulo.core.util.ArgumentChecker;
 import org.apache.accumulo.core.util.Pair;
 import org.apache.accumulo.core.util.TextUtil;
@@ -473,14 +473,15 @@ public class InputConfigurator extends C
    * @return an Accumulo tablet locator
    * @throws TableNotFoundException
    *           if the table name set on the configuration doesn't exist
+   * @throws AccumuloSecurityException 
    * @since 1.5.0
    */
-  public static TabletLocator getTabletLocator(Class<?> implementingClass, Configuration conf) throws TableNotFoundException {
+  public static TabletLocator getTabletLocator(Class<?> implementingClass, Configuration conf) throws TableNotFoundException, AccumuloSecurityException {
     String instanceType = conf.get(enumToConfKey(implementingClass, InstanceOpts.TYPE));
     if ("MockInstance".equals(instanceType))
       return new MockTabletLocator();
     Instance instance = getInstance(implementingClass, conf);
-    AccumuloToken<?,?> token = getToken(implementingClass, conf);
+    SecurityToken token = getToken(implementingClass, conf);
     String tableName = getInputTableName(implementingClass, conf);
     return TabletLocator.getInstance(instance, token, new Text(Tables.getTableId(instance, tableName)));
   }

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstance.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstance.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstance.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstance.java Mon Jan 28 21:03:43 2013
@@ -31,7 +31,7 @@ import org.apache.accumulo.core.client.I
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.security.thrift.AuthInfo;
 import org.apache.accumulo.core.security.thrift.SecurityErrorCode;
-import org.apache.accumulo.core.security.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.SecurityToken;
 import org.apache.accumulo.core.security.tokens.InstanceTokenWrapper;
 import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.accumulo.core.util.ByteBufferUtil;
@@ -51,6 +51,7 @@ import org.apache.hadoop.io.Text;
  * 
  */
 
+@SuppressWarnings("deprecation")
 public class MockInstance implements Instance {
   
   static final String genericAddress = "localhost:1234";
@@ -116,14 +117,14 @@ public class MockInstance implements Ins
   }
   
   /**
-   * @deprecated @since 1.5, use {@link #getConnector(AccumuloToken)}
+   * @deprecated @since 1.5, use {@link #getConnector(SecurityToken)}
    * @Override
    */
   public Connector getConnector(String user, byte[] pass) throws AccumuloException, AccumuloSecurityException {
     return getConnector(new UserPassToken(user, ByteBuffer.wrap(pass)));
   }
   
-  public Connector getConnector(AccumuloToken<?,?> token) throws AccumuloException, AccumuloSecurityException {
+  public Connector getConnector(SecurityToken token) throws AccumuloException, AccumuloSecurityException {
     if (!(token instanceof UserPassToken))
       throw new AccumuloException("Mock only accepts UserPassTokens");
     UserPassToken upt = (UserPassToken) token;
@@ -140,7 +141,7 @@ public class MockInstance implements Ins
     return getConnector(token.getToken());
   }
   /**
-   * @deprecated @since 1.5, use {@link #getConnector(AccumuloToken)}
+   * @deprecated @since 1.5, use {@link #getConnector(SecurityToken)}
    * @Override
    */
   public Connector getConnector(String user, ByteBuffer pass) throws AccumuloException, AccumuloSecurityException {
@@ -148,7 +149,7 @@ public class MockInstance implements Ins
   }
   
   /**
-   * @deprecated @since 1.5, use {@link #getConnector(AccumuloToken)}
+   * @deprecated @since 1.5, use {@link #getConnector(SecurityToken)}
    * @Override
    */
   public Connector getConnector(String user, CharSequence pass) throws AccumuloException, AccumuloSecurityException {
@@ -170,7 +171,7 @@ public class MockInstance implements Ins
   }
   
   /**
-   * @deprecated @since 1.5, use {@link #getConnector(AccumuloToken)}
+   * @deprecated @since 1.5, use {@link #getConnector(SecurityToken)}
    * @Override
    */
   public Connector getConnector(AuthInfo auth) throws AccumuloException, AccumuloSecurityException {

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockSecurityOperations.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockSecurityOperations.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockSecurityOperations.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockSecurityOperations.java Mon Jan 28 21:03:43 2013
@@ -27,9 +27,8 @@ import org.apache.accumulo.core.security
 import org.apache.accumulo.core.security.SystemPermission;
 import org.apache.accumulo.core.security.TablePermission;
 import org.apache.accumulo.core.security.thrift.SecurityErrorCode;
-import org.apache.accumulo.core.security.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.SecurityToken;
 import org.apache.accumulo.core.security.tokens.UserPassToken;
-import org.apache.accumulo.core.util.ByteBufferUtil;
 
 public class MockSecurityOperations implements SecurityOperations {
   
@@ -40,7 +39,7 @@ public class MockSecurityOperations impl
   }
   
   /**
-   * @deprecated Use {@link #createUser(AccumuloToken)} instead
+   * @deprecated Use {@link #createUser(SecurityToken)} instead
    */
   @Deprecated
   @Override
@@ -49,7 +48,7 @@ public class MockSecurityOperations impl
   }
   
   /**
-   * @deprecated @since 1.5, use {@link #createUser(AccumuloToken)}
+   * @deprecated @since 1.5, use {@link #createUser(SecurityToken)}
    * @param user
    * @param password
    * @throws AccumuloException
@@ -60,7 +59,7 @@ public class MockSecurityOperations impl
   }
   
   @Override
-  public void createUser(AccumuloToken<?,?> token, Authorizations authorization) throws AccumuloException, AccumuloSecurityException {
+  public void createUser(SecurityToken token, Authorizations authorization) throws AccumuloException, AccumuloSecurityException {
     if (token instanceof UserPassToken) {
       UserPassToken upt = (UserPassToken) token;
       this.acu.users.put(upt.getPrincipal(), new MockUser(upt.getPrincipal(), upt.getPassword(), authorization));
@@ -70,7 +69,7 @@ public class MockSecurityOperations impl
   }
   
   @Override
-  public void createUser(AccumuloToken<?,?> token) throws AccumuloException, AccumuloSecurityException {
+  public void createUser(SecurityToken token) throws AccumuloException, AccumuloSecurityException {
     createUser(token, new Authorizations());
   }
   
@@ -88,7 +87,7 @@ public class MockSecurityOperations impl
   }
 
   @Override
-  public boolean authenticateUser(AccumuloToken<?,?> token) throws AccumuloException, AccumuloSecurityException {
+  public boolean authenticateUser(SecurityToken token) throws AccumuloException, AccumuloSecurityException {
     MockUser user = acu.users.get(token.getPrincipal());
     if (user == null)
       return false;
@@ -96,7 +95,7 @@ public class MockSecurityOperations impl
   }
 
   /**
-   * @deprecated @since 1.5, use {@link #changeUserPassword(AccumuloToken)}
+   * @deprecated @since 1.5, use {@link #changeUserPassword(SecurityToken)}
    */
   @Override
   public void changeUserPassword(String name, byte[] password) throws AccumuloException, AccumuloSecurityException {
@@ -104,13 +103,13 @@ public class MockSecurityOperations impl
   }
   
   @Override
-  public void changeUserPassword(AccumuloToken<?,?> token) throws AccumuloException, AccumuloSecurityException {
+  public void changeUserPassword(SecurityToken token) throws AccumuloException, AccumuloSecurityException {
     MockUser user = acu.users.get(token.getPrincipal());
     if (user != null){
       if (token instanceof UserPassToken) {
         UserPassToken upt = (UserPassToken) token;
         // want to copy the password
-        user.password = ByteBufferUtil.toBytes(upt.password);
+        user.password = upt.getPassword();
       }
       else throw new AccumuloSecurityException(token.getPrincipal(), SecurityErrorCode.INVALID_TOKEN);
     }

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/tokens/InstanceTokenWrapper.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/tokens/InstanceTokenWrapper.java?rev=1439632&r1=1439631&r2=1439632&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/tokens/InstanceTokenWrapper.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/tokens/InstanceTokenWrapper.java Mon Jan 28 21:03:43 2013
@@ -22,19 +22,22 @@
  */
 package org.apache.accumulo.core.security.tokens;
 
+import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.security.thrift.ThriftInstanceTokenWrapper;
+import org.apache.log4j.Logger;
 
 public class InstanceTokenWrapper {
-  private AccumuloToken<?,?> token; // required
+  private SecurityToken token; // required
   private String instance; // required
   private ThriftInstanceTokenWrapper tikw = null;
+  Logger log = Logger.getLogger(InstanceTokenWrapper.class);
   
-  public InstanceTokenWrapper(AccumuloToken<?,?> token, String instance) {
+  public InstanceTokenWrapper(SecurityToken token, String instance) {
     this.token = token;
     this.instance = instance;
   }
   
-  public InstanceTokenWrapper(ThriftInstanceTokenWrapper credentials) {
+  public InstanceTokenWrapper(ThriftInstanceTokenWrapper credentials) throws AccumuloSecurityException {
     this.token = TokenHelper.unwrap(credentials.token);
     this.instance = credentials.instance;
   }
@@ -49,17 +52,17 @@ public class InstanceTokenWrapper {
     return this;
   }
   
-  public AccumuloToken<?,?> getToken() {
+  public SecurityToken getToken() {
     return this.token;
   }
   
-  public InstanceTokenWrapper setToken(AccumuloToken<?,?> token) {
+  public InstanceTokenWrapper setToken(SecurityToken token) {
     this.token = token;
     tikw = null;
     return this;
   }
   
-  public ThriftInstanceTokenWrapper toThrift() {
+  public ThriftInstanceTokenWrapper toThrift() throws AccumuloSecurityException {
     if (tikw == null)
       tikw = new ThriftInstanceTokenWrapper(TokenHelper.wrapper(token), token.getClass().getName(), instance);
     return tikw;

Added: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/tokens/KerberosSerDe.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/tokens/KerberosSerDe.java?rev=1439632&view=auto
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/tokens/KerberosSerDe.java (added)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/tokens/KerberosSerDe.java Mon Jan 28 21:03:43 2013
@@ -0,0 +1,88 @@
+package org.apache.accumulo.core.security.tokens;
+
+import java.io.ByteArrayInputStream;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+import org.apache.accumulo.core.client.AccumuloSecurityException;
+import org.apache.accumulo.core.security.thrift.SecurityErrorCode;
+import org.apache.accumulo.core.security.thrift.ThriftUserPassToken;
+import org.apache.commons.io.output.ByteArrayOutputStream;
+import org.apache.hadoop.io.WritableUtils;
+import org.apache.log4j.Logger;
+import org.apache.thrift.TDeserializer;
+import org.apache.thrift.TException;
+import org.apache.thrift.TSerializer;
+
+public class KerberosSerDe implements SecuritySerDe<KerberosToken> {
+  Logger log = Logger.getLogger(KerberosSerDe.class);
+  
+  @Override
+  public byte[] serialize(KerberosToken token) throws AccumuloSecurityException {
+    ThriftUserPassToken t = new ThriftUserPassToken(token.getPrincipal(), ByteBuffer.wrap(token.getSessionKey()));
+    TSerializer serializer = new TSerializer();
+    ByteArrayOutputStream bout = null;
+    DataOutputStream out = null;
+    try {
+      bout = new ByteArrayOutputStream();
+      out = new DataOutputStream(bout);
+      WritableUtils.writeCompressedByteArray(out, serializer.serialize(t));
+      return bout.toByteArray();
+    } catch (TException te) {
+      // This shouldn't happen
+      log.error(te);
+      throw new AccumuloSecurityException(token.getPrincipal(), SecurityErrorCode.INVALID_TOKEN);
+    } catch (IOException e) {
+      // This shouldn't happen
+      log.error(e);
+      throw new AccumuloSecurityException(token.getPrincipal(), SecurityErrorCode.INVALID_TOKEN);
+    } finally {
+      try {
+        if (bout != null)
+          bout.close();
+        if (out != null)
+          out.close();
+      } catch (IOException e) {
+        log.error(e);
+      }
+    }
+  }
+  
+  @Override
+  public KerberosToken deserialize(byte[] serializedToken) throws AccumuloSecurityException {
+    ByteArrayInputStream bin = null;
+    DataInputStream in = null;
+    try {
+      bin = new ByteArrayInputStream(serializedToken);
+      in = new DataInputStream(bin);
+      
+      TDeserializer deserializer = new TDeserializer();
+      ThriftUserPassToken obj = new ThriftUserPassToken();
+      byte[] tokenBytes;
+      tokenBytes = WritableUtils.readCompressedByteArray(in);
+      deserializer.deserialize(obj, tokenBytes);
+      
+      KerberosToken kt = new KerberosToken();
+      kt.setPrincipal(obj.user);
+      kt.setSessionKey(obj.getPassword());
+      return kt;
+    } catch (IOException e) {
+      log.error(e);
+      throw new AccumuloSecurityException("unknown user", SecurityErrorCode.INVALID_TOKEN);
+    } catch (TException e) {
+      log.error(e);
+      throw new AccumuloSecurityException("unknown user", SecurityErrorCode.INVALID_TOKEN);
+    } finally {
+      try {
+        if (bin != null)
+          bin.close();
+        if (in != null)
+          in.close();
+      } catch (IOException e) {
+        log.error(e);
+      }
+    }
+  }
+}

Propchange: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/tokens/KerberosSerDe.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message