accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1437605 [8/12] - in /accumulo/branches/ACCUMULO-259: 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/apac...
Date Wed, 23 Jan 2013 18:05:13 GMT
Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/MetadataTable.java Wed Jan 23 18:05:10 2013
@@ -39,7 +39,7 @@ import org.apache.accumulo.core.data.Key
 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.thrift.AuthInfo;
+import org.apache.accumulo.core.security.tokens.InstanceTokenWrapper;
 import org.apache.hadoop.io.Text;
 
 public class MetadataTable {
@@ -169,7 +169,7 @@ public class MetadataTable {
     return new Pair<SortedMap<KeyExtent,Text>,List<KeyExtent>>(results, locationless);
   }
   
-  public static SortedMap<Text,SortedMap<ColumnFQ,Value>> getTabletEntries(Instance instance, KeyExtent ke, List<ColumnFQ> columns, AuthInfo credentials) {
+  public static SortedMap<Text,SortedMap<ColumnFQ,Value>> getTabletEntries(Instance instance, KeyExtent ke, List<ColumnFQ> columns, InstanceTokenWrapper credentials) {
     TreeMap<Key,Value> tkv = new TreeMap<Key,Value>();
     getTabletAndPrevTabletKeyValues(instance, tkv, ke, columns, credentials);
     return getTabletEntries(tkv, columns);
@@ -203,7 +203,7 @@ public class MetadataTable {
     return tabletEntries;
   }
   
-  public static void getTabletAndPrevTabletKeyValues(Instance instance, SortedMap<Key,Value> tkv, KeyExtent ke, List<ColumnFQ> columns, AuthInfo credentials) {
+  public static void getTabletAndPrevTabletKeyValues(Instance instance, SortedMap<Key,Value> tkv, KeyExtent ke, List<ColumnFQ> columns, InstanceTokenWrapper credentials) {
     Text startRow;
     Text endRow = ke.getMetadataEntry();
     
@@ -236,11 +236,11 @@ public class MetadataTable {
     }
   }
   
-  public static void getEntries(Instance instance, AuthInfo credentials, String table, boolean isTid, Map<KeyExtent,String> locations,
+  public static void getEntries(Instance instance, InstanceTokenWrapper credentials, String table, boolean isTid, Map<KeyExtent,String> locations,
       SortedSet<KeyExtent> tablets) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
     String tableId = isTid ? table : Tables.getNameToIdMap(instance).get(table);
     
-    Scanner scanner = instance.getConnector(credentials.user, credentials.password).createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS);
+    Scanner scanner = instance.getConnector(credentials.getToken()).createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS);
     
     Constants.METADATA_PREV_ROW_COLUMN.fetch(scanner);
     scanner.fetchColumnFamily(Constants.METADATA_CURRENT_LOCATION_COLUMN_FAMILY);

Modified: accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateUserCommand.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateUserCommand.java?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateUserCommand.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateUserCommand.java Wed Jan 23 18:05:10 2013
@@ -22,6 +22,7 @@ import org.apache.accumulo.core.client.A
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.TableExistsException;
 import org.apache.accumulo.core.client.TableNotFoundException;
+import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.accumulo.core.util.shell.Shell;
 import org.apache.accumulo.core.util.shell.Shell.Command;
 import org.apache.commons.cli.CommandLine;
@@ -47,7 +48,7 @@ public class CreateUserCommand extends C
     if (!password.equals(passwordConfirm)) {
       throw new IllegalArgumentException("Passwords do not match");
     }
-    shellState.getConnector().securityOperations().createUser(user, password.getBytes());
+    shellState.getConnector().securityOperations().createUser(new UserPassToken(user, password));
     Shell.log.debug("Created user " + user);
     return 0;
   }

Modified: accumulo/branches/ACCUMULO-259/core/src/main/thrift/client.thrift
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/thrift/client.thrift?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/thrift/client.thrift (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/thrift/client.thrift Wed Jan 23 18:05:10 2013
@@ -70,30 +70,32 @@ service ClientService {
     string getInstanceId()
     string getZooKeepers()
     
-    list<string> bulkImportFiles(1:cloudtrace.TInfo tinfo, 2:security.AuthInfo credentials, 3:i64 tid, 4:string tableId, 5:list<string> files, 6:string errorDir, 7:bool setTime) throws (1:security.ThriftSecurityException sec, 2:ThriftTableOperationException tope);
+    list<string> bulkImportFiles(1:cloudtrace.TInfo tinfo, 2:security.ThriftInstanceTokenWrapper credentials, 3:i64 tid, 4:string tableId, 5:list<string> files, 6:string errorDir, 7:bool setTime) throws (1:security.ThriftSecurityException sec, 2:ThriftTableOperationException tope);
     // ensures that nobody is working on the transaction id above
     bool isActive(1:cloudtrace.TInfo tinfo, 2:i64 tid),
 
-    void ping(1:security.AuthInfo credentials) throws (1:security.ThriftSecurityException sec)
+    void ping(1:security.ThriftInstanceTokenWrapper credentials) throws (1:security.ThriftSecurityException sec)
 
     // user management methods
-    bool authenticateUser(4:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:string user, 3:binary password) throws (1:security.ThriftSecurityException sec)
-    set<string> listUsers(2:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials) throws (1:security.ThriftSecurityException sec)
-    void createUser(5:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:string user, 3:binary password, 4:list<binary> authorizations) throws (1:security.ThriftSecurityException sec)
-    void dropUser(3:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:string user) throws (1:security.ThriftSecurityException sec)
-    void changePassword(4:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:string user, 3:binary password) throws (1:security.ThriftSecurityException sec)
-    void changeAuthorizations(4:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:string user, 3:list<binary> authorizations) throws (1:security.ThriftSecurityException sec)
-    list<binary> getUserAuthorizations(3:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:string user) throws (1:security.ThriftSecurityException sec)
-    bool hasSystemPermission(4:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:string user, 3:byte sysPerm) throws (1:security.ThriftSecurityException sec)
-    bool hasTablePermission(5:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:string user, 3:string tableName, 4:byte tblPerm) throws (1:security.ThriftSecurityException sec, 2:ThriftTableOperationException tope)
-    void grantSystemPermission(4:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:string user, 3:byte permission) throws (1:security.ThriftSecurityException sec)
-    void revokeSystemPermission(4:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:string user, 3:byte permission) throws (1:security.ThriftSecurityException sec)
-    void grantTablePermission(5:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:string user, 3:string tableName, 4:byte permission) throws (1:security.ThriftSecurityException sec, 2:ThriftTableOperationException tope)
-    void revokeTablePermission(5:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:string user, 3:string tableName, 4:byte permission) throws (1:security.ThriftSecurityException sec, 2:ThriftTableOperationException tope)
+    bool authenticateUser(4:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 3:binary Token) throws (1:security.ThriftSecurityException sec)
+    set<string> listUsers(2:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials) throws (1:security.ThriftSecurityException sec)
+    void createUser(5:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:binary token, 3:list<binary> authorizations) throws (1:security.ThriftSecurityException sec)
+    void dropUser(3:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:string user) throws (1:security.ThriftSecurityException sec)
+    void changePassword(4:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:binary token) throws (1:security.ThriftSecurityException sec)
+    void changeAuthorizations(4:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:string user, 3:list<binary> authorizations) throws (1:security.ThriftSecurityException sec)
+    list<binary> getUserAuthorizations(3:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:string user) throws (1:security.ThriftSecurityException sec)
+    bool hasSystemPermission(4:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:string user, 3:byte sysPerm) throws (1:security.ThriftSecurityException sec)
+    bool hasTablePermission(5:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:string user, 3:string tableName, 4:byte tblPerm) throws (1:security.ThriftSecurityException sec, 2:ThriftTableOperationException tope)
+    void grantSystemPermission(4:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:string user, 3:byte permission) throws (1:security.ThriftSecurityException sec)
+    void revokeSystemPermission(4:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:string user, 3:byte permission) throws (1:security.ThriftSecurityException sec)
+    void grantTablePermission(5:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:string user, 3:string tableName, 4:byte permission) throws (1:security.ThriftSecurityException sec, 2:ThriftTableOperationException tope)
+    void revokeTablePermission(5:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:string user, 3:string tableName, 4:byte permission) throws (1:security.ThriftSecurityException sec, 2:ThriftTableOperationException tope)
     
     map<string, string> getConfiguration(1:ConfigurationType type);
     map<string, string> getTableConfiguration(2:string tableName) throws (1:ThriftTableOperationException tope);
     bool checkClass(1:cloudtrace.TInfo tinfo, 2:string className, 3:string interfaceMatch);
+    
+    string getSecurityTokenClass();
 }
 
 // Only used for a unit test

Modified: accumulo/branches/ACCUMULO-259/core/src/main/thrift/gc.thrift
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/thrift/gc.thrift?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/thrift/gc.thrift (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/thrift/gc.thrift Wed Jan 23 18:05:10 2013
@@ -38,5 +38,5 @@ struct GCStatus {
 
 
 service GCMonitorService {
-   GCStatus getStatus(2:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials) throws (1:security.ThriftSecurityException sec);
+   GCStatus getStatus(2:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials) throws (1:security.ThriftSecurityException sec);
 }

Modified: accumulo/branches/ACCUMULO-259/core/src/main/thrift/master.thrift
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/thrift/master.thrift?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/thrift/master.thrift (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/thrift/master.thrift Wed Jan 23 18:05:10 2013
@@ -131,29 +131,29 @@ enum TableOperation {
 service MasterClientService {
 
     // table management methods
-    i64 initiateFlush(3:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:string tableName) throws (1:security.ThriftSecurityException sec, 2:client.ThriftTableOperationException tope)
-    void waitForFlush(5:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:string tableName, 6:binary startRow, 7:binary endRow, 3:i64 flushID, 4:i64 maxLoops) throws (1:security.ThriftSecurityException sec, 2:client.ThriftTableOperationException tope)
+    i64 initiateFlush(3:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:string tableName) throws (1:security.ThriftSecurityException sec, 2:client.ThriftTableOperationException tope)
+    void waitForFlush(5:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:string tableName, 6:binary startRow, 7:binary endRow, 3:i64 flushID, 4:i64 maxLoops) throws (1:security.ThriftSecurityException sec, 2:client.ThriftTableOperationException tope)
     
-    void setTableProperty(5:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:string tableName, 3:string property, 4:string value) throws (1:security.ThriftSecurityException sec, 2:client.ThriftTableOperationException tope)
-    void removeTableProperty(4:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:string tableName, 3:string property) throws (1:security.ThriftSecurityException sec, 2:client.ThriftTableOperationException tope)
+    void setTableProperty(5:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:string tableName, 3:string property, 4:string value) throws (1:security.ThriftSecurityException sec, 2:client.ThriftTableOperationException tope)
+    void removeTableProperty(4:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:string tableName, 3:string property) throws (1:security.ThriftSecurityException sec, 2:client.ThriftTableOperationException tope)
 
     // system management methods
-    void setMasterGoalState(3:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:MasterGoalState state) throws (1:security.ThriftSecurityException sec);
-    void shutdown(3:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:bool stopTabletServers) throws (1:security.ThriftSecurityException sec)
-    void shutdownTabletServer(3:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:string tabletServer, 4:bool force) throws (1: security.ThriftSecurityException sec)
-    void setSystemProperty(4:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:string property, 3:string value) throws (1:security.ThriftSecurityException sec)
-    void removeSystemProperty(3:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:string property) throws (1:security.ThriftSecurityException sec)
+    void setMasterGoalState(3:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:MasterGoalState state) throws (1:security.ThriftSecurityException sec);
+    void shutdown(3:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:bool stopTabletServers) throws (1:security.ThriftSecurityException sec)
+    void shutdownTabletServer(3:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:string tabletServer, 4:bool force) throws (1: security.ThriftSecurityException sec)
+    void setSystemProperty(4:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:string property, 3:string value) throws (1:security.ThriftSecurityException sec)
+    void removeSystemProperty(3:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:string property) throws (1:security.ThriftSecurityException sec)
 
     // system monitoring methods
-    MasterMonitorInfo getMasterStats(2:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials) throws (1:security.ThriftSecurityException sec)
+    MasterMonitorInfo getMasterStats(2:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials) throws (1:security.ThriftSecurityException sec)
     
     // tablet server reporting
-    oneway void reportSplitExtent(4:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:string serverName, 3:TabletSplit split)
-    oneway void reportTabletStatus(5:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:string serverName, 3:TabletLoadState status, 4:data.TKeyExtent tablet)
+    oneway void reportSplitExtent(4:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:string serverName, 3:TabletSplit split)
+    oneway void reportTabletStatus(5:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:string serverName, 3:TabletLoadState status, 4:data.TKeyExtent tablet)
 
    //table operations
-   i64 beginTableOperation(2:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials) throws (1:security.ThriftSecurityException sec)
-   void executeTableOperation(7:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:i64 opid, 3:TableOperation op, 4:list<binary> arguments, 5:map<string, string> options, 6:bool autoClean)throws (1:security.ThriftSecurityException sec, 2:client.ThriftTableOperationException tope)
-   string waitForTableOperation(3:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:i64 opid) throws (1:security.ThriftSecurityException sec, 2:client.ThriftTableOperationException tope)
-   void finishTableOperation(3:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:i64 opid) throws (1:security.ThriftSecurityException sec)
+   i64 beginTableOperation(2:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials) throws (1:security.ThriftSecurityException sec)
+   void executeTableOperation(7:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:i64 opid, 3:TableOperation op, 4:list<binary> arguments, 5:map<string, string> options, 6:bool autoClean)throws (1:security.ThriftSecurityException sec, 2:client.ThriftTableOperationException tope)
+   string waitForTableOperation(3:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:i64 opid) throws (1:security.ThriftSecurityException sec, 2:client.ThriftTableOperationException tope)
+   void finishTableOperation(3:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:i64 opid) throws (1:security.ThriftSecurityException sec)
 }

Modified: accumulo/branches/ACCUMULO-259/core/src/main/thrift/security.thrift
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/thrift/security.thrift?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/thrift/security.thrift (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/thrift/security.thrift Wed Jan 23 18:05:10 2013
@@ -28,15 +28,25 @@ enum SecurityErrorCode {
     BAD_AUTHORIZATIONS = 7,
     INVALID_INSTANCEID = 8,
     TABLE_DOESNT_EXIST = 9,
-    UNSUPPORTED_OPERATION = 10
+    UNSUPPORTED_OPERATION = 10,
+    INVALID_TOKEN = 11
 }
 
-struct AuthInfo {
+struct ThriftUserPassToken {
     1:string user,
-    2:binary password,
-    3:string instanceId
+    2:binary password
 }
 
+struct ThriftKerberosToken {
+	1:string user,
+	2:binary ticket
+}
+
+struct ThriftInstanceTokenWrapper {
+	1: binary token,
+	2: string tokenClass,
+	3: string instance
+}
 exception ThriftSecurityException {
     1:string user,
     2:SecurityErrorCode code

Modified: accumulo/branches/ACCUMULO-259/core/src/main/thrift/tabletserver.thrift
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/main/thrift/tabletserver.thrift?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/main/thrift/tabletserver.thrift (original)
+++ accumulo/branches/ACCUMULO-259/core/src/main/thrift/tabletserver.thrift Wed Jan 23 18:05:10 2013
@@ -101,7 +101,7 @@ struct IteratorConfig {
 service TabletClientService extends client.ClientService {
   // scan a range of keys
   data.InitialScan startScan(11:cloudtrace.TInfo tinfo,
-                             1:security.AuthInfo credentials,
+                             1:security.ThriftInstanceTokenWrapper credentials,
                              2:data.TKeyExtent extent,
                              3:data.TRange range,
                              4:list<data.TColumn> columns,
@@ -117,7 +117,7 @@ service TabletClientService extends clie
 
   // scan over a series of ranges
   data.InitialMultiScan startMultiScan(8:cloudtrace.TInfo tinfo,
-                                  1:security.AuthInfo credentials,
+                                  1:security.ThriftInstanceTokenWrapper credentials,
                                   2:data.ScanBatch batch,
                                   3:list<data.TColumn> columns,
                                   4:list<data.IterInfo> ssiList,
@@ -128,36 +128,36 @@ service TabletClientService extends clie
   void closeMultiScan(2:cloudtrace.TInfo tinfo, 1:data.ScanID scanID) throws (1:NoSuchScanIDException nssi),
   
   //the following calls support a batch update to multiple tablets on a tablet server
-  data.UpdateID startUpdate(2:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials) throws (1:security.ThriftSecurityException sec),
+  data.UpdateID startUpdate(2:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials) throws (1:security.ThriftSecurityException sec),
   oneway void applyUpdates(1:cloudtrace.TInfo tinfo, 2:data.UpdateID updateID, 3:data.TKeyExtent keyExtent, 4:list<data.TMutation> mutations),
   data.UpdateErrors closeUpdate(2:cloudtrace.TInfo tinfo, 1:data.UpdateID updateID) throws (1:NoSuchScanIDException nssi),
   
   //the following call supports making a single update to a tablet
-  void update(4:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:data.TKeyExtent keyExtent, 3:data.TMutation mutation)
+  void update(4:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:data.TKeyExtent keyExtent, 3:data.TMutation mutation)
     throws (1:security.ThriftSecurityException sec, 
             2:NotServingTabletException nste, 
             3:ConstraintViolationException cve),
   
   // on success, returns an empty list
-  list<data.TKeyExtent> bulkImport(3:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 4:i64 tid, 2:data.TabletFiles files, 5:bool setTime) throws (1:security.ThriftSecurityException sec),
+  list<data.TKeyExtent> bulkImport(3:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 4:i64 tid, 2:data.TabletFiles files, 5:bool setTime) throws (1:security.ThriftSecurityException sec),
 
-  void splitTablet(4:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:data.TKeyExtent extent, 3:binary splitPoint) throws (1:security.ThriftSecurityException sec, 2:NotServingTabletException nste)
+  void splitTablet(4:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:data.TKeyExtent extent, 3:binary splitPoint) throws (1:security.ThriftSecurityException sec, 2:NotServingTabletException nste)
  
-  oneway void loadTablet(5:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 4:string lock, 2:data.TKeyExtent extent),
-  oneway void unloadTablet(5:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 4:string lock, 2:data.TKeyExtent extent, 3:bool save),
-  oneway void flush(4:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 3:string lock, 2:string tableId, 5:binary startRow, 6:binary endRow),
-  oneway void flushTablet(1:cloudtrace.TInfo tinfo, 2:security.AuthInfo credentials, 3:string lock, 4:data.TKeyExtent extent),
-  oneway void chop(1:cloudtrace.TInfo tinfo, 2:security.AuthInfo credentials, 3:string lock, 4:data.TKeyExtent extent),
-  oneway void compact(1:cloudtrace.TInfo tinfo, 2:security.AuthInfo credentials, 3:string lock, 4:string tableId, 5:binary startRow, 6:binary endRow),
+  oneway void loadTablet(5:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 4:string lock, 2:data.TKeyExtent extent),
+  oneway void unloadTablet(5:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 4:string lock, 2:data.TKeyExtent extent, 3:bool save),
+  oneway void flush(4:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 3:string lock, 2:string tableId, 5:binary startRow, 6:binary endRow),
+  oneway void flushTablet(1:cloudtrace.TInfo tinfo, 2:security.ThriftInstanceTokenWrapper credentials, 3:string lock, 4:data.TKeyExtent extent),
+  oneway void chop(1:cloudtrace.TInfo tinfo, 2:security.ThriftInstanceTokenWrapper credentials, 3:string lock, 4:data.TKeyExtent extent),
+  oneway void compact(1:cloudtrace.TInfo tinfo, 2:security.ThriftInstanceTokenWrapper credentials, 3:string lock, 4:string tableId, 5:binary startRow, 6:binary endRow),
   
-  master.TabletServerStatus getTabletServerStatus(3:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials) throws (1:security.ThriftSecurityException sec)
-  list<TabletStats> getTabletStats(3:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:string tableId) throws (1:security.ThriftSecurityException sec)
-  TabletStats getHistoricalStats(2:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials) throws (1:security.ThriftSecurityException sec)
-  void halt(3:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:string lock) throws (1:security.ThriftSecurityException sec)
-  oneway void fastHalt(3:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials, 2:string lock);
+  master.TabletServerStatus getTabletServerStatus(3:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials) throws (1:security.ThriftSecurityException sec)
+  list<TabletStats> getTabletStats(3:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:string tableId) throws (1:security.ThriftSecurityException sec)
+  TabletStats getHistoricalStats(2:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials) throws (1:security.ThriftSecurityException sec)
+  void halt(3:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:string lock) throws (1:security.ThriftSecurityException sec)
+  oneway void fastHalt(3:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials, 2:string lock);
   
-  list<ActiveScan> getActiveScans(2:cloudtrace.TInfo tinfo, 1:security.AuthInfo credentials) throws (1:security.ThriftSecurityException sec)
-  oneway void removeLogs(1:cloudtrace.TInfo tinfo, 2:security.AuthInfo credentials, 3:list<string> filenames)
+  list<ActiveScan> getActiveScans(2:cloudtrace.TInfo tinfo, 1:security.ThriftInstanceTokenWrapper credentials) throws (1:security.ThriftSecurityException sec)
+  oneway void removeLogs(1:cloudtrace.TInfo tinfo, 2:security.ThriftInstanceTokenWrapper credentials, 3:list<string> filenames)
 }
 
 typedef i32 TabletID

Modified: accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/admin/FindMaxTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/admin/FindMaxTest.java?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/admin/FindMaxTest.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/admin/FindMaxTest.java Wed Jan 23 18:05:10 2013
@@ -30,6 +30,7 @@ import org.apache.accumulo.core.client.m
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.hadoop.io.Text;
 
 public class FindMaxTest extends TestCase {
@@ -49,7 +50,7 @@ public class FindMaxTest extends TestCas
   public void test1() throws Exception {
     MockInstance mi = new MockInstance();
     
-    Connector conn = mi.getConnector("root", "");
+    Connector conn = mi.getConnector(new UserPassToken("root", ""));
     conn.tableOperations().create("foo");
     
     BatchWriter bw = conn.createBatchWriter("foo", new BatchWriterConfig());

Modified: accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java Wed Jan 23 18:05:10 2013
@@ -48,6 +48,8 @@ import org.apache.accumulo.core.data.Par
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.security.thrift.AuthInfo;
+import org.apache.accumulo.core.security.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.InstanceTokenWrapper;
 import org.apache.accumulo.core.util.MetadataTable;
 import org.apache.accumulo.core.util.Pair;
 import org.apache.hadoop.io.Text;
@@ -417,12 +419,23 @@ public class TabletLocatorImplTest exten
       this.rtl = rtl;
     }
     
+    /**
+     * @deprecated @since 1.5
+     */
     @Override
     public Connector getConnector(String user, byte[] pass) throws AccumuloException, AccumuloSecurityException {
       throw new UnsupportedOperationException();
     }
     
     @Override
+    public Connector getConnector(InstanceTokenWrapper itw) throws AccumuloException, AccumuloSecurityException {
+      throw new UnsupportedOperationException();
+    }
+    
+    /**
+     * @deprecated @since 1.5
+     */
+    @Override
     public Connector getConnector(String user, ByteBuffer pass) throws AccumuloException, AccumuloSecurityException {
       throw new UnsupportedOperationException();
     }
@@ -439,15 +452,25 @@ public class TabletLocatorImplTest exten
       this.conf = conf;
     }
     
+    /**
+     * @deprecated @since 1.5
+     */
     @Override
     public Connector getConnector(String user, CharSequence pass) throws AccumuloException, AccumuloSecurityException {
       throw new UnsupportedOperationException();
     }
     
+    /**
+     * @deprecated @since 1.5
+     */
     @Override
     public Connector getConnector(AuthInfo auth) throws AccumuloException, AccumuloSecurityException {
       return getConnector(auth.user, auth.password);
     }
+    
+    public Connector getConnector(AccumuloToken<?,?> token) throws AccumuloException, AccumuloSecurityException {
+      throw new UnsupportedOperationException();
+    }
   }
   
   static class TServers {

Modified: accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloInputFormatTest.java Wed Jan 23 18:05:10 2013
@@ -36,6 +36,7 @@ import org.apache.accumulo.core.data.Val
 import org.apache.accumulo.core.iterators.user.RegExFilter;
 import org.apache.accumulo.core.iterators.user.WholeRowIterator;
 import org.apache.accumulo.core.security.Authorizations;
+import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.accumulo.core.util.ContextFactory;
 import org.apache.commons.codec.binary.Base64;
 import org.apache.hadoop.conf.Configuration;
@@ -242,7 +243,7 @@ public class AccumuloInputFormatTest {
   @Test
   public void testMap() throws Exception {
     MockInstance mockInstance = new MockInstance("testmapinstance");
-    Connector c = mockInstance.getConnector("root", new byte[] {});
+    Connector c = mockInstance.getConnector(new UserPassToken("root", ""));
     c.tableOperations().create("testtable");
     BatchWriter bw = c.createBatchWriter("testtable", new BatchWriterConfig());
     for (int i = 0; i < 100; i++) {
@@ -276,7 +277,7 @@ public class AccumuloInputFormatTest {
   @Test
   public void testSimple() throws Exception {
     MockInstance mockInstance = new MockInstance("testmapinstance");
-    Connector c = mockInstance.getConnector("root", new byte[] {});
+    Connector c = mockInstance.getConnector(new UserPassToken("root", ""));
     c.tableOperations().create("testtable2");
     BatchWriter bw = c.createBatchWriter("testtable2", new BatchWriterConfig());
     for (int i = 0; i < 100; i++) {

Modified: accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormatTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormatTest.java?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormatTest.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloOutputFormatTest.java Wed Jan 23 18:05:10 2013
@@ -34,6 +34,7 @@ import org.apache.accumulo.core.data.Key
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.security.Authorizations;
+import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.accumulo.core.util.ContextFactory;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.mapreduce.InputSplit;
@@ -76,7 +77,7 @@ public class AccumuloOutputFormatTest {
   @Test
   public void testMR() throws Exception {
     MockInstance mockInstance = new MockInstance("testmrinstance");
-    Connector c = mockInstance.getConnector("root", new byte[] {});
+    Connector c = mockInstance.getConnector(new UserPassToken("root", ""));
     c.tableOperations().create("testtable1");
     c.tableOperations().create("testtable2");
     BatchWriter bw = c.createBatchWriter("testtable1", new BatchWriterConfig());

Modified: accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloRowInputFormatTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloRowInputFormatTest.java?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloRowInputFormatTest.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/mapreduce/AccumuloRowInputFormatTest.java Wed Jan 23 18:05:10 2013
@@ -42,6 +42,7 @@ import org.apache.accumulo.core.data.Mut
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.security.ColumnVisibility;
+import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.accumulo.core.util.ContextFactory;
 import org.apache.accumulo.core.util.PeekingIterator;
 import org.apache.hadoop.io.Text;
@@ -101,7 +102,7 @@ public class AccumuloRowInputFormatTest 
   @Test
   public void test() throws AccumuloException, AccumuloSecurityException, TableExistsException, TableNotFoundException, IOException, InterruptedException {
     final MockInstance instance = new MockInstance("instance1");
-    final Connector conn = instance.getConnector("root", "".getBytes());
+    final Connector conn = instance.getConnector(new UserPassToken("root", ""));
     conn.tableOperations().create("test");
     BatchWriter writer = null; // NOPMD
     try {

Modified: accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java Wed Jan 23 18:05:10 2013
@@ -44,6 +44,7 @@ import org.apache.accumulo.core.data.Val
 import org.apache.accumulo.core.iterators.Combiner;
 import org.apache.accumulo.core.iterators.user.SummingCombiner;
 import org.apache.accumulo.core.security.Authorizations;
+import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.hadoop.io.Text;
 import org.junit.Test;
 
@@ -83,7 +84,7 @@ public class MockConnectorTest {
   @Test
   public void testChangeAuths() throws Exception {
     Connector c = new MockConnector("root", new MockInstance());
-    c.securityOperations().createUser("greg", new byte[] {});
+    c.securityOperations().createUser(new UserPassToken("greg", new byte[0]));
     assertTrue(c.securityOperations().getUserAuthorizations("greg").isEmpty());
     c.securityOperations().changeUserAuthorizations("greg", new Authorizations("A".getBytes()));
     assertTrue(c.securityOperations().getUserAuthorizations("greg").contains("A".getBytes()));
@@ -95,7 +96,7 @@ public class MockConnectorTest {
   @Test
   public void testAggregation() throws Exception {
     MockInstance mockInstance = new MockInstance();
-    Connector c = mockInstance.getConnector("root", new byte[] {});
+    Connector c = mockInstance.getConnector(new UserPassToken("root", ""));
     String table = "perDayCounts";
     c.tableOperations().create(table);
     IteratorSetting is = new IteratorSetting(10, "String Summation", SummingCombiner.class);
@@ -343,8 +344,8 @@ public class MockConnectorTest {
       AccumuloSecurityException{
     String name = "an-interesting-instance-name";
     Instance mockInstance = new MockInstance(name);
-    assertEquals(mockInstance, mockInstance.getConnector("foo", "bar").getInstance());
-    assertEquals(name, mockInstance.getConnector("foo","bar").getInstance().getInstanceName());
+    assertEquals(mockInstance, mockInstance.getConnector(new UserPassToken("foo", "bar")).getInstance());
+    assertEquals(name, mockInstance.getConnector(new UserPassToken("foo", "bar")).getInstance().getInstanceName());
   }
 
 }

Modified: accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java Wed Jan 23 18:05:10 2013
@@ -18,7 +18,6 @@ package org.apache.accumulo.core.client.
 
 import java.io.IOException;
 import java.net.URI;
-import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.EnumSet;
@@ -53,7 +52,7 @@ import org.apache.accumulo.core.iterator
 import org.apache.accumulo.core.iterators.user.VersioningIterator;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.security.ColumnVisibility;
-import org.apache.accumulo.core.security.thrift.AuthInfo;
+import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.accumulo.core.util.Pair;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
@@ -67,7 +66,7 @@ public class MockTableOperationsTest {
     @Test
     public void testCreateUseVersions() throws AccumuloException, AccumuloSecurityException, TableExistsException, TableNotFoundException {
         Instance instance = new MockInstance("topstest");
-        Connector conn = instance.getConnector("user", "pass");
+        Connector conn = instance.getConnector(new UserPassToken("root", ""));
         String t = "tableName1";
         
         {
@@ -129,7 +128,7 @@ public class MockTableOperationsTest {
   @Test
   public void testTableNotFound() throws AccumuloException, AccumuloSecurityException, TableExistsException, TableNotFoundException {
     Instance instance = new MockInstance("topstest");
-    Connector conn = instance.getConnector("user", "pass");
+    Connector conn = instance.getConnector(new UserPassToken("root", ""));
     String t = "tableName";
     try {
       conn.tableOperations().attachIterator(t, null);
@@ -188,8 +187,7 @@ public class MockTableOperationsTest {
   public void testImport() throws Throwable {
     ImportTestFilesAndData dataAndFiles = prepareTestFiles();
     Instance instance = new MockInstance("foo");
-    Connector connector = instance.getConnector(new AuthInfo("user", ByteBuffer
-        .wrap(new byte[0]), "foo"));
+    Connector connector = instance.getConnector(new UserPassToken("root", ""));
     TableOperations tableOperations = connector.tableOperations();
     tableOperations.create("a_table");
     tableOperations.importDirectory("a_table",
@@ -242,8 +240,7 @@ public class MockTableOperationsTest {
   @Test(expected = TableNotFoundException.class)
   public void testFailsWithNoTable() throws Throwable {
     Instance instance = new MockInstance("foo");
-    Connector connector = instance.getConnector(new AuthInfo("user", ByteBuffer
-        .wrap(new byte[0]), "foo"));
+    Connector connector = instance.getConnector(new UserPassToken("root", ""));
     TableOperations tableOperations = connector.tableOperations();
     ImportTestFilesAndData testFiles = prepareTestFiles();
     tableOperations.importDirectory("doesnt_exist_table",
@@ -254,8 +251,7 @@ public class MockTableOperationsTest {
   @Test(expected = IOException.class)
   public void testFailsWithNonEmptyFailureDirectory() throws Throwable {
     Instance instance = new MockInstance("foo");
-    Connector connector = instance.getConnector(new AuthInfo("user", ByteBuffer
-        .wrap(new byte[0]), "foo"));
+    Connector connector = instance.getConnector(new UserPassToken("root", ""));
     TableOperations tableOperations = connector.tableOperations();
     ImportTestFilesAndData testFiles = prepareTestFiles();
     FileSystem fs = testFiles.failurePath.getFileSystem(new Configuration());
@@ -268,7 +264,7 @@ public class MockTableOperationsTest {
   @Test
   public void testDeleteRows() throws Exception {
     Instance instance = new MockInstance("rows");
-    Connector connector = instance.getConnector("user", "foo");
+    Connector connector = instance.getConnector(new UserPassToken("root", ""));
     TableOperations to = connector.tableOperations();
     to.create("test");
     BatchWriter bw = connector.createBatchWriter("test", new BatchWriterConfig());

Modified: accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/mock/TestBatchScanner821.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/mock/TestBatchScanner821.java?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/mock/TestBatchScanner821.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/client/mock/TestBatchScanner821.java Wed Jan 23 18:05:10 2013
@@ -31,6 +31,7 @@ import org.apache.accumulo.core.data.Key
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.junit.Test;
 
 public class TestBatchScanner821 {
@@ -38,7 +39,7 @@ public class TestBatchScanner821 {
   @Test
   public void test() throws Exception {
     MockInstance inst = new MockInstance();
-    Connector conn = inst.getConnector("root", "");
+    Connector conn = inst.getConnector(new UserPassToken("root", ""));
     conn.tableOperations().create("test");
     BatchWriter bw = conn.createBatchWriter("test", new BatchWriterConfig());
     for (String row : "A,B,C,D".split(",")) {

Modified: accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/iterators/user/IntersectingIteratorTest.java Wed Jan 23 18:05:10 2013
@@ -45,6 +45,7 @@ import org.apache.accumulo.core.iterator
 import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
 import org.apache.accumulo.core.iterators.SortedMapIterator;
 import org.apache.accumulo.core.iterators.system.MultiIterator;
+import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.hadoop.io.Text;
 import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
@@ -272,7 +273,7 @@ public class IntersectingIteratorTest ex
   public void testWithBatchScanner() throws Exception {
     Value empty = new Value(new byte[] {});
     MockInstance inst = new MockInstance("mockabye");
-    Connector connector = inst.getConnector("user", "pass");
+    Connector connector = inst.getConnector(new UserPassToken("user", "pass"));
     connector.tableOperations().create("index");
     BatchWriter bw = connector.createBatchWriter("index", new BatchWriterConfig());
     Mutation m = new Mutation("000012");

Modified: accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java (original)
+++ accumulo/branches/ACCUMULO-259/core/src/test/java/org/apache/accumulo/core/iterators/user/RowFilterTest.java Wed Jan 23 18:05:10 2013
@@ -36,6 +36,7 @@ import org.apache.accumulo.core.data.Mut
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
+import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.hadoop.io.Text;
 
 /**
@@ -82,7 +83,7 @@ public class RowFilterTest extends TestC
 
   public void test1() throws Exception {
     MockInstance instance = new MockInstance("rft1");
-    Connector conn = instance.getConnector("", "".getBytes());
+    Connector conn = instance.getConnector(new UserPassToken("", ""));
     
     conn.tableOperations().create("table1");
     BatchWriter bw = conn.createBatchWriter("table1", new BatchWriterConfig());

Modified: accumulo/branches/ACCUMULO-259/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/FileDataIngest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/FileDataIngest.java?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/FileDataIngest.java (original)
+++ accumulo/branches/ACCUMULO-259/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/FileDataIngest.java Wed Jan 23 18:05:10 2013
@@ -98,28 +98,31 @@ public class FileDataIngest {
     bw.addMutation(m);
     
     // read through file again, writing chunks to accumulo
-    fis = new FileInputStream(filename);
-    numRead = fis.read(buf);
     int chunkCount = 0;
-    while (numRead >= 0) {
-      while (numRead < buf.length) {
-        int moreRead = fis.read(buf, numRead, buf.length - numRead);
-        if (moreRead > 0)
-          numRead += moreRead;
-        else if (moreRead < 0)
-          break;
-      }
-      m = new Mutation(row);
-      Text chunkCQ = new Text(chunkSizeBytes);
-      chunkCQ.append(intToBytes(chunkCount), 0, 4);
-      m.put(CHUNK_CF, chunkCQ, cv, new Value(buf, 0, numRead));
-      bw.addMutation(m);
-      if (chunkCount == Integer.MAX_VALUE)
-        throw new RuntimeException("too many chunks for file " + filename + ", try raising chunk size");
-      chunkCount++;
+    try {
+      fis = new FileInputStream(filename);
       numRead = fis.read(buf);
+      while (numRead >= 0) {
+        while (numRead < buf.length) {
+          int moreRead = fis.read(buf, numRead, buf.length - numRead);
+          if (moreRead > 0)
+            numRead += moreRead;
+          else if (moreRead < 0)
+            break;
+        }
+        m = new Mutation(row);
+        Text chunkCQ = new Text(chunkSizeBytes);
+        chunkCQ.append(intToBytes(chunkCount), 0, 4);
+        m.put(CHUNK_CF, chunkCQ, cv, new Value(buf, 0, numRead));
+        bw.addMutation(m);
+        if (chunkCount == Integer.MAX_VALUE)
+          throw new RuntimeException("too many chunks for file " + filename + ", try raising chunk size");
+        chunkCount++;
+        numRead = fis.read(buf);
+      }
+    } finally {
+      fis.close();
     }
-    fis.close();
     m = new Mutation(row);
     Text chunkCQ = new Text(chunkSizeBytes);
     chunkCQ.append(intToBytes(chunkCount), 0, 4);
@@ -159,17 +162,16 @@ public class FileDataIngest {
   }
   
   public static class Opts extends ClientOnRequiredTable {
-    @Parameter(names="--vis", description="use a given visibility for the new counts", converter=VisibilityConverter.class)
+    @Parameter(names = "--vis", description = "use a given visibility for the new counts", converter = VisibilityConverter.class)
     ColumnVisibility visibility = new ColumnVisibility();
     
-    @Parameter(names="--chunk", description="size of the chunks used to store partial files")
-    int chunkSize = 64*1024;
+    @Parameter(names = "--chunk", description = "size of the chunks used to store partial files")
+    int chunkSize = 64 * 1024;
     
-    @Parameter(description="<file> { <file> ... }")
+    @Parameter(description = "<file> { <file> ... }")
     List<String> files = new ArrayList<String>();
   }
   
-  
   public static void main(String[] args) throws Exception {
     Opts opts = new Opts();
     BatchWriterOpts bwOpts = new BatchWriterOpts();

Modified: accumulo/branches/ACCUMULO-259/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/FileDataQuery.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/FileDataQuery.java?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/FileDataQuery.java (original)
+++ accumulo/branches/ACCUMULO-259/examples/simple/src/main/java/org/apache/accumulo/examples/simple/filedata/FileDataQuery.java Wed Jan 23 18:05:10 2013
@@ -31,6 +31,7 @@ import org.apache.accumulo.core.data.Key
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.security.Authorizations;
+import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.accumulo.core.util.PeekingIterator;
 
 /**
@@ -46,7 +47,7 @@ public class FileDataQuery {
   public FileDataQuery(String instanceName, String zooKeepers, String user, byte[] password, String tableName, Authorizations auths) throws AccumuloException,
       AccumuloSecurityException, TableNotFoundException {
     ZooKeeperInstance instance = new ZooKeeperInstance(instanceName, zooKeepers);
-    conn = instance.getConnector(user, password);
+    conn = instance.getConnector(new UserPassToken(user, password));
     lastRefs = new ArrayList<Entry<Key,Value>>();
     cis = new ChunkInputStream();
     scanner = conn.createScanner(tableName, auths);

Modified: accumulo/branches/ACCUMULO-259/examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/CountTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/CountTest.java?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/CountTest.java (original)
+++ accumulo/branches/ACCUMULO-259/examples/simple/src/test/java/org/apache/accumulo/examples/simple/dirlist/CountTest.java Wed Jan 23 18:05:10 2013
@@ -18,12 +18,14 @@ package org.apache.accumulo.examples.sim
 
 import java.util.ArrayList;
 import java.util.Map.Entry;
+import java.util.concurrent.TimeUnit;
 
 import junit.framework.TestCase;
 
 import org.apache.accumulo.core.cli.BatchWriterOpts;
 import org.apache.accumulo.core.cli.ScannerOpts;
 import org.apache.accumulo.core.client.BatchWriter;
+import org.apache.accumulo.core.client.BatchWriterConfig;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.client.mock.MockInstance;
@@ -31,6 +33,7 @@ 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.ColumnVisibility;
+import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.accumulo.core.util.Pair;
 import org.apache.accumulo.examples.simple.dirlist.FileCount.Opts;
 import org.apache.hadoop.io.Text;
@@ -38,9 +41,9 @@ import org.apache.hadoop.io.Text;
 public class CountTest extends TestCase {
   {
     try {
-      Connector conn = new MockInstance("counttest").getConnector("root", "".getBytes());
+      Connector conn = new MockInstance("counttest").getConnector(new UserPassToken("root", ""));
       conn.tableOperations().create("dirlisttable");
-      BatchWriter bw = conn.createBatchWriter("dirlisttable", 1000000l, 100l, 1);
+      BatchWriter bw = conn.createBatchWriter("dirlisttable", new BatchWriterConfig().setMaxMemory(1000000l).setMaxLatency(100l, TimeUnit.SECONDS).setMaxWriteThreads(1));
       ColumnVisibility cv = new ColumnVisibility();
       // / has 1 dir
       // /local has 2 dirs 1 file
@@ -59,7 +62,7 @@ public class CountTest extends TestCase 
   }
   
   public void test() throws Exception {
-    Scanner scanner = new MockInstance("counttest").getConnector("root", "".getBytes()).createScanner("dirlisttable", new Authorizations());
+    Scanner scanner = new MockInstance("counttest").getConnector(new UserPassToken("root", "")).createScanner("dirlisttable", new Authorizations());
     scanner.fetchColumn(new Text("dir"), new Text("counts"));
     assertFalse(scanner.iterator().hasNext());
     

Modified: accumulo/branches/ACCUMULO-259/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputFormatTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputFormatTest.java?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputFormatTest.java (original)
+++ accumulo/branches/ACCUMULO-259/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputFormatTest.java Wed Jan 23 18:05:10 2013
@@ -21,12 +21,14 @@ import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map.Entry;
+import java.util.concurrent.TimeUnit;
 
 import junit.framework.TestCase;
 
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.BatchWriter;
+import org.apache.accumulo.core.client.BatchWriterConfig;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.TableExistsException;
 import org.apache.accumulo.core.client.TableNotFoundException;
@@ -37,6 +39,7 @@ import org.apache.accumulo.core.data.Mut
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.security.ColumnVisibility;
+import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.accumulo.core.util.ContextFactory;
 import org.apache.hadoop.mapreduce.JobContext;
 import org.apache.hadoop.mapreduce.RecordReader;
@@ -73,9 +76,9 @@ public class ChunkInputFormatTest extend
   
   public void test() throws IOException, InterruptedException, AccumuloException, AccumuloSecurityException, TableExistsException, TableNotFoundException {
     MockInstance instance = new MockInstance("instance1");
-    Connector conn = instance.getConnector("root", "".getBytes());
+    Connector conn = instance.getConnector(new UserPassToken("root", ""));
     conn.tableOperations().create("test");
-    BatchWriter bw = conn.createBatchWriter("test", 100000l, 100l, 5);
+    BatchWriter bw = conn.createBatchWriter("test", new BatchWriterConfig().setMaxMemory(1000000l).setMaxLatency(100l, TimeUnit.SECONDS).setMaxWriteThreads(5));
     
     for (Entry<Key,Value> e : data) {
       Key k = e.getKey();
@@ -124,9 +127,9 @@ public class ChunkInputFormatTest extend
   public void testErrorOnNextWithoutClose() throws IOException, InterruptedException, AccumuloException, AccumuloSecurityException, TableNotFoundException,
       TableExistsException {
     MockInstance instance = new MockInstance("instance2");
-    Connector conn = instance.getConnector("root", "".getBytes());
+    Connector conn = instance.getConnector(new UserPassToken("root", ""));
     conn.tableOperations().create("test");
-    BatchWriter bw = conn.createBatchWriter("test", 100000l, 100l, 5);
+    BatchWriter bw = conn.createBatchWriter("test", new BatchWriterConfig().setMaxMemory(1000000l).setMaxLatency(100l, TimeUnit.SECONDS).setMaxWriteThreads(5));
     
     for (Entry<Key,Value> e : data) {
       Key k = e.getKey();
@@ -164,9 +167,9 @@ public class ChunkInputFormatTest extend
   public void testInfoWithoutChunks() throws IOException, InterruptedException, AccumuloException, AccumuloSecurityException, TableNotFoundException,
       TableExistsException {
     MockInstance instance = new MockInstance("instance3");
-    Connector conn = instance.getConnector("root", "".getBytes());
+    Connector conn = instance.getConnector(new UserPassToken("root", ""));
     conn.tableOperations().create("test");
-    BatchWriter bw = conn.createBatchWriter("test", 100000l, 100l, 5);
+    BatchWriter bw = conn.createBatchWriter("test", new BatchWriterConfig().setMaxMemory(1000000l).setMaxLatency(100l, TimeUnit.SECONDS).setMaxWriteThreads(5));
     for (Entry<Key,Value> e : baddata) {
       Key k = e.getKey();
       Mutation m = new Mutation(k.getRow());

Modified: accumulo/branches/ACCUMULO-259/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputStreamTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputStreamTest.java?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputStreamTest.java (original)
+++ accumulo/branches/ACCUMULO-259/examples/simple/src/test/java/org/apache/accumulo/examples/simple/filedata/ChunkInputStreamTest.java Wed Jan 23 18:05:10 2013
@@ -20,12 +20,14 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map.Entry;
+import java.util.concurrent.TimeUnit;
 
 import junit.framework.TestCase;
 
 import org.apache.accumulo.core.client.AccumuloException;
 import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.BatchWriter;
+import org.apache.accumulo.core.client.BatchWriterConfig;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.client.TableExistsException;
@@ -37,6 +39,7 @@ import org.apache.accumulo.core.data.Mut
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.security.Authorizations;
 import org.apache.accumulo.core.security.ColumnVisibility;
+import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.accumulo.core.util.PeekingIterator;
 import org.apache.hadoop.io.Text;
 import org.apache.log4j.Logger;
@@ -220,9 +223,9 @@ public class ChunkInputStreamTest extend
   }
   
   public void testWithAccumulo() throws AccumuloException, AccumuloSecurityException, TableExistsException, TableNotFoundException, IOException {
-    Connector conn = new MockInstance().getConnector("root", "".getBytes());
+    Connector conn = new MockInstance().getConnector(new UserPassToken("root", ""));
     conn.tableOperations().create("test");
-    BatchWriter bw = conn.createBatchWriter("test", 100000l, 100l, 5);
+    BatchWriter bw = conn.createBatchWriter("test", new BatchWriterConfig().setMaxMemory(1000000l).setMaxLatency(100l, TimeUnit.SECONDS).setMaxWriteThreads(5));
     
     for (Entry<Key,Value> e : data) {
       Key k = e.getKey();

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/client/BulkImporter.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/client/BulkImporter.java?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/client/BulkImporter.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/client/BulkImporter.java Wed Jan 23 18:05:10 2013
@@ -53,8 +53,8 @@ import org.apache.accumulo.core.data.thr
 import org.apache.accumulo.core.file.FileOperations;
 import org.apache.accumulo.core.file.FileSKVIterator;
 import org.apache.accumulo.core.file.FileUtil;
-import org.apache.accumulo.core.security.thrift.AuthInfo;
 import org.apache.accumulo.core.security.thrift.ThriftSecurityException;
+import org.apache.accumulo.core.security.tokens.InstanceTokenWrapper;
 import org.apache.accumulo.core.tabletserver.thrift.TabletClientService;
 import org.apache.accumulo.core.util.CachedConfiguration;
 import org.apache.accumulo.core.util.LoggingRunnable;
@@ -74,7 +74,7 @@ public class BulkImporter {
   
   private static final Logger log = Logger.getLogger(BulkImporter.class);
   
-  public static List<String> bulkLoad(AccumuloConfiguration conf, Instance instance, AuthInfo creds, long tid, String tableId, List<String> files,
+  public static List<String> bulkLoad(AccumuloConfiguration conf, Instance instance, InstanceTokenWrapper creds, long tid, String tableId, List<String> files,
       String errorDir, boolean setTime) throws IOException, AccumuloException, AccumuloSecurityException, ThriftTableOperationException {
     AssignmentStats stats = new BulkImporter(conf, instance, creds, tid, tableId, setTime).importFiles(files, new Path(errorDir));
     List<String> result = new ArrayList<String>();
@@ -91,13 +91,13 @@ public class BulkImporter {
   }
   
   private Instance instance;
-  private AuthInfo credentials;
+  private InstanceTokenWrapper credentials;
   private String tableId;
   private long tid;
   private AccumuloConfiguration acuConf;
   private boolean setTime;
   
-  public BulkImporter(AccumuloConfiguration conf, Instance instance, AuthInfo credentials, long tid, String tableId, boolean setTime) {
+  public BulkImporter(AccumuloConfiguration conf, Instance instance, InstanceTokenWrapper credentials, long tid, String tableId, boolean setTime) {
     this.instance = instance;
     this.credentials = credentials;
     this.tid = tid;
@@ -415,7 +415,7 @@ public class BulkImporter {
     return result;
   }
   
-  private Map<Path,List<KeyExtent>> assignMapFiles(AccumuloConfiguration acuConf, Instance instance, Configuration conf, AuthInfo credentials, FileSystem fs,
+  private Map<Path,List<KeyExtent>> assignMapFiles(AccumuloConfiguration acuConf, Instance instance, Configuration conf, InstanceTokenWrapper credentials, FileSystem fs,
       String tableId, Map<Path,List<TabletLocation>> assignments, Collection<Path> paths, int numThreads, int numMapThreads) {
     timer.start(Timers.EXAMINE_MAP_FILES);
     Map<Path,List<AssignmentInfo>> assignInfo = estimateSizes(acuConf, conf, fs, assignments, paths, numMapThreads);
@@ -433,10 +433,10 @@ public class BulkImporter {
   private class AssignmentTask implements Runnable {
     final Map<Path,List<KeyExtent>> assignmentFailures;
     String location;
-    AuthInfo credentials;
+    InstanceTokenWrapper credentials;
     private Map<KeyExtent,List<PathSize>> assignmentsPerTablet;
     
-    public AssignmentTask(AuthInfo credentials, Map<Path,List<KeyExtent>> assignmentFailures, String tableName, String location,
+    public AssignmentTask(InstanceTokenWrapper credentials, Map<Path,List<KeyExtent>> assignmentFailures, String tableName, String location,
         Map<KeyExtent,List<PathSize>> assignmentsPerTablet) {
       this.assignmentFailures = assignmentFailures;
       this.location = location;
@@ -497,7 +497,7 @@ public class BulkImporter {
     }
   }
   
-  private Map<Path,List<KeyExtent>> assignMapFiles(AuthInfo credentials, String tableName, Map<Path,List<AssignmentInfo>> assignments,
+  private Map<Path,List<KeyExtent>> assignMapFiles(InstanceTokenWrapper credentials, String tableName, Map<Path,List<AssignmentInfo>> assignments,
       Map<KeyExtent,String> locations, int numThreads) {
     
     // group assignments by tablet
@@ -575,7 +575,7 @@ public class BulkImporter {
     return assignmentFailures;
   }
   
-  private List<KeyExtent> assignMapFiles(AuthInfo credentials, String location, Map<KeyExtent,List<PathSize>> assignmentsPerTablet) throws AccumuloException,
+  private List<KeyExtent> assignMapFiles(InstanceTokenWrapper credentials, String location, Map<KeyExtent,List<PathSize>> assignmentsPerTablet) throws AccumuloException,
       AccumuloSecurityException {
     try {
       long timeInMillis = instance.getConfiguration().getTimeInMillis(Property.TSERV_BULK_TIMEOUT);
@@ -593,7 +593,7 @@ public class BulkImporter {
         }
         
         log.debug("Asking " + location + " to bulk load " + files);
-        List<TKeyExtent> failures = client.bulkImport(Tracer.traceInfo(), credentials, tid, Translator.translate(files, Translator.KET), setTime);
+        List<TKeyExtent> failures = client.bulkImport(Tracer.traceInfo(), credentials.toThrift(), tid, Translator.translate(files, Translator.KET), setTime);
         
         return Translator.translate(failures, Translator.TKET);
       } finally {

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java Wed Jan 23 18:05:10 2013
@@ -39,10 +39,11 @@ import org.apache.accumulo.core.conf.Pro
 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.thrift.AuthInfo;
 import org.apache.accumulo.core.security.thrift.SecurityErrorCode;
+import org.apache.accumulo.core.security.thrift.ThriftInstanceTokenWrapper;
 import org.apache.accumulo.core.security.thrift.ThriftSecurityException;
-import org.apache.accumulo.core.util.ByteBufferUtil;
+import org.apache.accumulo.core.security.tokens.InstanceTokenWrapper;
+import org.apache.accumulo.core.security.tokens.TokenHelper;
 import org.apache.accumulo.server.conf.ServerConfiguration;
 import org.apache.accumulo.server.security.AuditedSecurityOperation;
 import org.apache.accumulo.server.security.SecurityOperation;
@@ -91,80 +92,80 @@ public class ClientServiceHandler implem
   }
   
   @Override
-  public void ping(AuthInfo credentials) {
+  public void ping(ThriftInstanceTokenWrapper credentials) {
     // anybody can call this; no authentication check
     log.info("Master reports: I just got pinged!");
   }
   
   @Override
-  public boolean authenticateUser(TInfo tinfo, AuthInfo credentials, String user, ByteBuffer password) throws ThriftSecurityException {
-    return security.authenticateUser(credentials, user, password);
+  public boolean authenticateUser(TInfo tinfo, ThriftInstanceTokenWrapper credentials, ByteBuffer token) throws ThriftSecurityException {
+    return security.authenticateUser(new InstanceTokenWrapper(credentials), TokenHelper.unwrap(token));
   }
   
   @Override
-  public void changeAuthorizations(TInfo tinfo, AuthInfo credentials, String user, List<ByteBuffer> authorizations) throws ThriftSecurityException {
-    security.changeAuthorizations(credentials, user, new Authorizations(authorizations));
+  public void changeAuthorizations(TInfo tinfo, ThriftInstanceTokenWrapper credentials, String user, List<ByteBuffer> authorizations) throws ThriftSecurityException {
+    security.changeAuthorizations(new InstanceTokenWrapper(credentials), user, new Authorizations(authorizations));
   }
   
   @Override
-  public void changePassword(TInfo tinfo, AuthInfo credentials, String user, ByteBuffer password) throws ThriftSecurityException {
-    security.changePassword(credentials, user, ByteBufferUtil.toBytes(password));
+  public void changePassword(TInfo tinfo, ThriftInstanceTokenWrapper credentials, ByteBuffer token) throws ThriftSecurityException {
+    security.changePassword(new InstanceTokenWrapper(credentials), TokenHelper.unwrap(token));
   }
   
   @Override
-  public void createUser(TInfo tinfo, AuthInfo credentials, String user, ByteBuffer password, List<ByteBuffer> authorizations) throws ThriftSecurityException {
-    security.createUser(credentials, user, ByteBufferUtil.toBytes(password), new Authorizations(authorizations));
+  public void createUser(TInfo tinfo, ThriftInstanceTokenWrapper credentials, ByteBuffer token, List<ByteBuffer> authorizations) throws ThriftSecurityException {
+    security.createUser(new InstanceTokenWrapper(credentials), TokenHelper.unwrap(token), new Authorizations(authorizations));
   }
   
   @Override
-  public void dropUser(TInfo tinfo, AuthInfo credentials, String user) throws ThriftSecurityException {
-    security.dropUser(credentials, user);
+  public void dropUser(TInfo tinfo, ThriftInstanceTokenWrapper credentials, String user) throws ThriftSecurityException {
+    security.dropUser(new InstanceTokenWrapper(credentials), user);
   }
   
   @Override
-  public List<ByteBuffer> getUserAuthorizations(TInfo tinfo, AuthInfo credentials, String user) throws ThriftSecurityException {
-    return security.getUserAuthorizations(credentials, user).getAuthorizationsBB();
+  public List<ByteBuffer> getUserAuthorizations(TInfo tinfo, ThriftInstanceTokenWrapper credentials, String user) throws ThriftSecurityException {
+    return security.getUserAuthorizations(new InstanceTokenWrapper(credentials), user).getAuthorizationsBB();
   }
   
   @Override
-  public void grantSystemPermission(TInfo tinfo, AuthInfo credentials, String user, byte permission) throws ThriftSecurityException {
-    security.grantSystemPermission(credentials, user, SystemPermission.getPermissionById(permission));
+  public void grantSystemPermission(TInfo tinfo, ThriftInstanceTokenWrapper credentials, String user, byte permission) throws ThriftSecurityException {
+    security.grantSystemPermission(new InstanceTokenWrapper(credentials), user, SystemPermission.getPermissionById(permission));
   }
   
   @Override
-  public void grantTablePermission(TInfo tinfo, AuthInfo credentials, String user, String tableName, byte permission) throws ThriftSecurityException,
+  public void grantTablePermission(TInfo tinfo, ThriftInstanceTokenWrapper credentials, String user, String tableName, byte permission) throws ThriftSecurityException,
       ThriftTableOperationException {
     String tableId = checkTableId(tableName, TableOperation.PERMISSION);
-    security.grantTablePermission(credentials, user, tableId, TablePermission.getPermissionById(permission));
+    security.grantTablePermission(new InstanceTokenWrapper(credentials), user, tableId, TablePermission.getPermissionById(permission));
   }
   
   @Override
-  public void revokeSystemPermission(TInfo tinfo, AuthInfo credentials, String user, byte permission) throws ThriftSecurityException {
-    security.revokeSystemPermission(credentials, user, SystemPermission.getPermissionById(permission));
+  public void revokeSystemPermission(TInfo tinfo, ThriftInstanceTokenWrapper credentials, String user, byte permission) throws ThriftSecurityException {
+    security.revokeSystemPermission(new InstanceTokenWrapper(credentials), user, SystemPermission.getPermissionById(permission));
   }
   
   @Override
-  public void revokeTablePermission(TInfo tinfo, AuthInfo credentials, String user, String tableName, byte permission) throws ThriftSecurityException,
+  public void revokeTablePermission(TInfo tinfo, ThriftInstanceTokenWrapper credentials, String user, String tableName, byte permission) throws ThriftSecurityException,
       ThriftTableOperationException {
     String tableId = checkTableId(tableName, TableOperation.PERMISSION);
-    security.revokeTablePermission(credentials, user, tableId, TablePermission.getPermissionById(permission));
+    security.revokeTablePermission(new InstanceTokenWrapper(credentials), user, tableId, TablePermission.getPermissionById(permission));
   }
   
   @Override
-  public boolean hasSystemPermission(TInfo tinfo, AuthInfo credentials, String user, byte sysPerm) throws ThriftSecurityException {
-    return security.hasSystemPermission(credentials, user, SystemPermission.getPermissionById(sysPerm));
+  public boolean hasSystemPermission(TInfo tinfo, ThriftInstanceTokenWrapper credentials, String user, byte sysPerm) throws ThriftSecurityException {
+    return security.hasSystemPermission(new InstanceTokenWrapper(credentials), user, SystemPermission.getPermissionById(sysPerm));
   }
   
   @Override
-  public boolean hasTablePermission(TInfo tinfo, AuthInfo credentials, String user, String tableName, byte tblPerm) throws ThriftSecurityException,
+  public boolean hasTablePermission(TInfo tinfo, ThriftInstanceTokenWrapper credentials, String user, String tableName, byte tblPerm) throws ThriftSecurityException,
       ThriftTableOperationException {
     String tableId = checkTableId(tableName, TableOperation.PERMISSION);
-    return security.hasTablePermission(credentials, user, tableId, TablePermission.getPermissionById(tblPerm));
+    return security.hasTablePermission(new InstanceTokenWrapper(credentials), user, tableId, TablePermission.getPermissionById(tblPerm));
   }
   
   @Override
-  public Set<String> listUsers(TInfo tinfo, AuthInfo credentials) throws ThriftSecurityException {
-    return security.listUsers(credentials);
+  public Set<String> listUsers(TInfo tinfo, ThriftInstanceTokenWrapper credentials) throws ThriftSecurityException {
+    return security.listUsers(new InstanceTokenWrapper(credentials));
   }
   
   static private Map<String,String> conf(AccumuloConfiguration conf) {
@@ -197,11 +198,12 @@ public class ClientServiceHandler implem
   }
   
   @Override
-  public List<String> bulkImportFiles(TInfo tinfo, final AuthInfo credentials, final long tid, final String tableId, final List<String> files,
+  public List<String> bulkImportFiles(TInfo tinfo, final ThriftInstanceTokenWrapper tikw, final long tid, final String tableId, final List<String> files,
       final String errorDir, final boolean setTime) throws ThriftSecurityException, ThriftTableOperationException, TException {
     try {
-      if (!security.hasSystemPermission(credentials, credentials.getUser(), SystemPermission.SYSTEM))
-        throw new AccumuloSecurityException(credentials.getUser(), SecurityErrorCode.PERMISSION_DENIED);
+      final InstanceTokenWrapper credentials = new InstanceTokenWrapper(tikw);
+      if (!security.hasSystemPermission(credentials, credentials.getPrincipal(), SystemPermission.SYSTEM))
+        throw new AccumuloSecurityException(credentials.getPrincipal(), SecurityErrorCode.PERMISSION_DENIED);
       return transactionWatcher.run(Constants.BULK_ARBITRATOR_TYPE, tid, new Callable<List<String>>() {
         public List<String> call() throws Exception {
           return BulkImporter.bulkLoad(new ServerConfiguration(instance).getConfiguration(), instance, credentials, tid, tableId, files, errorDir,
@@ -244,4 +246,9 @@ public class ClientServiceHandler implem
       return false;
     }
   }
+
+  @Override
+  public String getSecurityTokenClass() throws TException {
+    return security.getTokenClassName();
+  }
 }

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java Wed Jan 23 18:05:10 2013
@@ -31,7 +31,9 @@ import org.apache.accumulo.core.client.i
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.security.thrift.AuthInfo;
-import org.apache.accumulo.core.util.ByteBufferUtil;
+import org.apache.accumulo.core.security.tokens.AccumuloToken;
+import org.apache.accumulo.core.security.tokens.InstanceTokenWrapper;
+import org.apache.accumulo.core.security.tokens.UserPassToken;
 import org.apache.accumulo.core.util.OpTimer;
 import org.apache.accumulo.core.util.StringUtil;
 import org.apache.accumulo.core.util.TextUtil;
@@ -139,20 +141,25 @@ public class HdfsZooInstance implements 
     return (int) ServerConfiguration.getSiteConfiguration().getTimeInMillis(Property.INSTANCE_ZK_TIMEOUT);
   }
   
-  @SuppressWarnings("deprecation")
+  /**
+   * @deprecated since 1.5, use {@link #getConnector(AccumuloToken)}
+   */
   @Override
-  // Not really deprecated, just not for client use
   public Connector getConnector(String user, byte[] pass) throws AccumuloException, AccumuloSecurityException {
-    return new ConnectorImpl(this, user, pass);
+    return getConnector(new UserPassToken(user, pass));
   }
   
-  @SuppressWarnings("deprecation")
+  /**
+   * @deprecated since 1.5, use {@link #getConnector(AccumuloToken)}
+   */
   @Override
-  // Not really deprecated, just not for client use
   public Connector getConnector(String user, ByteBuffer pass) throws AccumuloException, AccumuloSecurityException {
-    return new ConnectorImpl(this, user, ByteBufferUtil.toBytes(pass));
+    return getConnector(new UserPassToken(user, pass));
   }
   
+  /**
+   * @deprecated since 1.5, use {@link #getConnector(AccumuloToken)}
+   */
   @Override
   public Connector getConnector(String user, CharSequence pass) throws AccumuloException, AccumuloSecurityException {
     return getConnector(user, TextUtil.getBytes(new Text(pass.toString())));
@@ -180,8 +187,21 @@ public class HdfsZooInstance implements 
     System.out.println("Masters: " + StringUtil.join(instance.getMasterLocations(), ", "));
   }
   
+  /**
+   * @deprecated since 1.5, use {@link #getConnector(AccumuloToken)}
+   */
   @Override
   public Connector getConnector(AuthInfo auth) throws AccumuloException, AccumuloSecurityException {
-    return getConnector(auth.user, auth.password);
+    return getConnector(UserPassToken.convertAuthInfo(auth));
+  }
+  
+  @SuppressWarnings("deprecation")
+  public Connector getConnector(AccumuloToken<?,?> token) throws AccumuloException, AccumuloSecurityException {
+    return new ConnectorImpl(this, token);
+  }
+
+  @Override
+  public Connector getConnector(InstanceTokenWrapper token) throws AccumuloException, AccumuloSecurityException {
+    return getConnector(token.getToken());
   }
 }

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/gc/GarbageCollectWriteAheadLogs.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/gc/GarbageCollectWriteAheadLogs.java?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/gc/GarbageCollectWriteAheadLogs.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/gc/GarbageCollectWriteAheadLogs.java Wed Jan 23 18:05:10 2013
@@ -141,7 +141,7 @@ public class GarbageCollectWriteAheadLog
         Client tserver = null;
         try {
           tserver = ThriftUtil.getClient(new TabletClientService.Client.Factory(), address, conf);
-          tserver.removeLogs(Tracer.traceInfo(), SecurityConstants.getSystemCredentials(), entry.getValue());
+          tserver.removeLogs(Tracer.traceInfo(), SecurityConstants.getSystemCredentials().toThrift(), entry.getValue());
           log.debug("deleted " + entry.getValue() + " from " + entry.getKey());
           status.currentLog.deleted += entry.getValue().size();
         } catch (TException e) {

Modified: accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java?rev=1437605&r1=1437604&r2=1437605&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java (original)
+++ accumulo/branches/ACCUMULO-259/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java Wed Jan 23 18:05:10 2013
@@ -64,7 +64,8 @@ import org.apache.accumulo.core.gc.thrif
 import org.apache.accumulo.core.gc.thrift.GCStatus;
 import org.apache.accumulo.core.gc.thrift.GcCycleStats;
 import org.apache.accumulo.core.master.state.tables.TableState;
-import org.apache.accumulo.core.security.thrift.AuthInfo;
+import org.apache.accumulo.core.security.thrift.ThriftInstanceTokenWrapper;
+import org.apache.accumulo.core.security.tokens.InstanceTokenWrapper;
 import org.apache.accumulo.core.util.CachedConfiguration;
 import org.apache.accumulo.core.util.NamingThreadFactory;
 import org.apache.accumulo.core.util.ServerServices;
@@ -119,7 +120,7 @@ public class SimpleGarbageCollector impl
   
   private static final Logger log = Logger.getLogger(SimpleGarbageCollector.class);
     
-  private AuthInfo credentials;
+  private InstanceTokenWrapper credentials;
   private long gcStartDelay;
   private boolean checkForBulkProcessingFiles;
   private FileSystem fs;
@@ -179,7 +180,7 @@ public class SimpleGarbageCollector impl
     this.address = address;
   }
 
-  public void init(FileSystem fs, Instance instance, AuthInfo credentials, boolean noTrash) throws IOException {
+  public void init(FileSystem fs, Instance instance, InstanceTokenWrapper credentials, boolean noTrash) throws IOException {
     this.fs = TraceFileSystem.wrap(fs);
     this.credentials = credentials;
     this.instance = instance;
@@ -688,7 +689,7 @@ public class SimpleGarbageCollector impl
   }
   
   @Override
-  public GCStatus getStatus(TInfo info, AuthInfo credentials) {
+  public GCStatus getStatus(TInfo info, ThriftInstanceTokenWrapper credentials) {
     return status;
   }
 }



Mime
View raw message