You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2013/02/24 16:18:47 UTC
svn commit: r1449493 [2/2] - in /accumulo/branches/ACCUMULO-259-polishing:
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/client/impl/ core/src/m...
Modified: accumulo/branches/ACCUMULO-259-polishing/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259-polishing/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java?rev=1449493&r1=1449492&r2=1449493&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259-polishing/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java (original)
+++ accumulo/branches/ACCUMULO-259-polishing/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java Sun Feb 24 15:18:46 2013
@@ -450,18 +450,19 @@ public class TabletLocatorImplTest exten
public Connector getConnector(TCredentials auth) throws AccumuloException, AccumuloSecurityException {
return getConnector(auth.getPrincipal(), auth.getToken());
}
-
+
+ @Deprecated
@Override
public Connector getConnector(AuthInfo auth) throws AccumuloException, AccumuloSecurityException {
return getConnector(auth.user, auth.getPassword());
}
-
+
@Override
public String getAuthenticatorClassName() throws AccumuloException {
return null;
// Doesn't matter
}
-
+
@Override
public Connector getConnector(String principal, AuthenticationToken token) throws AccumuloException, AccumuloSecurityException {
throw new UnsupportedOperationException();
@@ -592,7 +593,7 @@ public class TabletLocatorImplTest exten
throw new RuntimeException("Asked for empty tablet, but non empty tablet exists");
}
}
-
+
static void setLocation(TServers tservers, String server, KeyExtent tablet, KeyExtent ke, String location) {
Map<KeyExtent,SortedMap<Key,Value>> tablets = tservers.tservers.get(server);
if (tablets == null) {
Modified: accumulo/branches/ACCUMULO-259-polishing/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259-polishing/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java?rev=1449493&r1=1449492&r2=1449493&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259-polishing/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java (original)
+++ accumulo/branches/ACCUMULO-259-polishing/core/src/test/java/org/apache/accumulo/core/client/mock/MockConnectorTest.java Sun Feb 24 15:18:46 2013
@@ -84,7 +84,7 @@ public class MockConnectorTest {
@Test
public void testChangeAuths() throws Exception {
Connector c = new MockConnector("root", new MockInstance());
- c.securityOperations().createUser("greg", new PasswordToken(new byte[0]));
+ c.securityOperations().createLocalUser("greg", new PasswordToken(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()));
Modified: accumulo/branches/ACCUMULO-259-polishing/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259-polishing/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java?rev=1449493&r1=1449492&r2=1449493&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259-polishing/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java (original)
+++ accumulo/branches/ACCUMULO-259-polishing/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java Sun Feb 24 15:18:46 2013
@@ -66,7 +66,6 @@ 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.TCredentials;
-import org.apache.accumulo.core.security.tokens.AuthenticationToken;
import org.apache.accumulo.core.security.tokens.PasswordToken;
import org.apache.accumulo.core.util.ByteBufferUtil;
import org.apache.accumulo.core.util.TextUtil;
@@ -611,7 +610,7 @@ public class ProxyServer implements Accu
@Override
public boolean authenticateUser(ByteBuffer login, String user, ByteBuffer password) throws TException {
try {
- return getConnector(login).securityOperations().authenticateUser(user, ByteBufferUtil.toBytes(password));
+ return getConnector(login).securityOperations().authenticateUser(user, new PasswordToken(password));
} catch (Exception e) {
throw translateException(e);
}
@@ -633,7 +632,7 @@ public class ProxyServer implements Accu
@Override
public void changeUserPassword(ByteBuffer login, String user, ByteBuffer password) throws TException {
try {
- getConnector(login).securityOperations().changeUserPassword(user, ByteBufferUtil.toBytes(password));
+ getConnector(login).securityOperations().changeLocalUserPassword(user, new PasswordToken(password));
} catch (Exception e) {
throw translateException(e);
}
@@ -642,8 +641,8 @@ public class ProxyServer implements Accu
@Override
public void createUser(ByteBuffer login, String user, ByteBuffer password) throws TException {
try {
- AuthenticationToken st = new PasswordToken(password);
- getConnector(login).securityOperations().createUser(user, st);
+ PasswordToken st = new PasswordToken(password);
+ getConnector(login).securityOperations().createLocalUser(user, st);
} catch (Exception e) {
throw translateException(e);
}
@@ -652,7 +651,7 @@ public class ProxyServer implements Accu
@Override
public void dropUser(ByteBuffer login, String user) throws TException {
try {
- getConnector(login).securityOperations().dropUser(user);
+ getConnector(login).securityOperations().dropLocalUser(user);
} catch (Exception e) {
throw translateException(e);
}
@@ -706,7 +705,7 @@ public class ProxyServer implements Accu
@Override
public Set<String> listUsers(ByteBuffer login) throws TException {
try {
- return getConnector(login).securityOperations().listUsers();
+ return getConnector(login).securityOperations().listLocalUsers();
} catch (Exception e) {
throw translateException(e);
}
Modified: accumulo/branches/ACCUMULO-259-polishing/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259-polishing/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java?rev=1449493&r1=1449492&r2=1449493&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259-polishing/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java (original)
+++ accumulo/branches/ACCUMULO-259-polishing/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java Sun Feb 24 15:18:46 2013
@@ -127,6 +127,7 @@ public class HdfsZooInstance implements
return instanceId;
}
+ @SuppressWarnings("deprecation")
private static synchronized void _getInstanceID() {
if (instanceId == null) {
instanceId = ZooKeeperInstance.getInstanceIDFromHdfs(ServerConstants.getInstanceIdLocation());
Modified: accumulo/branches/ACCUMULO-259-polishing/server/src/main/java/org/apache/accumulo/server/tabletserver/log/DfsLogger.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259-polishing/server/src/main/java/org/apache/accumulo/server/tabletserver/log/DfsLogger.java?rev=1449493&r1=1449492&r2=1449493&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259-polishing/server/src/main/java/org/apache/accumulo/server/tabletserver/log/DfsLogger.java (original)
+++ accumulo/branches/ACCUMULO-259-polishing/server/src/main/java/org/apache/accumulo/server/tabletserver/log/DfsLogger.java Sun Feb 24 15:18:46 2013
@@ -40,7 +40,6 @@ import org.apache.accumulo.core.conf.Acc
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.KeyExtent;
import org.apache.accumulo.core.data.Mutation;
-import org.apache.accumulo.core.security.crypto.CryptoModule;
import org.apache.accumulo.core.security.crypto.CryptoModuleFactory;
import org.apache.accumulo.core.util.Daemon;
import org.apache.accumulo.core.util.StringUtil;
@@ -217,7 +216,7 @@ public class DfsLogger {
this.logPath = new Path(Constants.getWalDirectory(conf.getConfiguration()), filename);
}
- public static FSDataInputStream readHeader(FileSystem fs, Path path, Map<String, String> opts) throws IOException {
+ public static FSDataInputStream readHeader(FileSystem fs, Path path, Map<String,String> opts) throws IOException {
FSDataInputStream file = fs.open(path);
try {
byte[] magic = LOG_FILE_HEADER_V2.getBytes();
@@ -252,7 +251,7 @@ public class DfsLogger {
FileSystem fs = conf.getFileSystem();
short replication = (short) conf.getConfiguration().getCount(Property.TSERV_WAL_REPLICATION);
if (replication == 0)
- replication = (short) fs.getDefaultReplication();
+ replication = fs.getDefaultReplication();
long blockSize = conf.getConfiguration().getMemoryInBytes(Property.TSERV_WAL_BLOCKSIZE);
if (blockSize == 0)
blockSize = (long) (conf.getConfiguration().getMemoryInBytes(Property.TSERV_WALOG_MAX_SIZE) * 1.1);
@@ -263,7 +262,8 @@ public class DfsLogger {
// Initialize the crypto operations.
@SuppressWarnings("deprecation")
- CryptoModule cryptoModule = CryptoModuleFactory.getCryptoModule(conf.getConfiguration().get(Property.CRYPTO_MODULE_CLASS));
+ org.apache.accumulo.core.security.crypto.CryptoModule cryptoModule = CryptoModuleFactory.getCryptoModule(conf.getConfiguration().get(
+ Property.CRYPTO_MODULE_CLASS));
// Initialize the log file with a header and the crypto params used to set up this log file.
logFile.write(LOG_FILE_HEADER_V2.getBytes());
Modified: accumulo/branches/ACCUMULO-259-polishing/server/src/main/java/org/apache/accumulo/server/tabletserver/log/LogSorter.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259-polishing/server/src/main/java/org/apache/accumulo/server/tabletserver/log/LogSorter.java?rev=1449493&r1=1449492&r2=1449493&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259-polishing/server/src/main/java/org/apache/accumulo/server/tabletserver/log/LogSorter.java (original)
+++ accumulo/branches/ACCUMULO-259-polishing/server/src/main/java/org/apache/accumulo/server/tabletserver/log/LogSorter.java Sun Feb 24 15:18:46 2013
@@ -34,7 +34,6 @@ 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.master.thrift.RecoveryStatus;
-import org.apache.accumulo.core.security.crypto.CryptoModule;
import org.apache.accumulo.core.security.crypto.CryptoModuleFactory;
import org.apache.accumulo.core.util.Pair;
import org.apache.accumulo.core.util.SimpleThreadPool;
@@ -137,7 +136,7 @@ public class LogSorter {
}
@SuppressWarnings("deprecation")
- CryptoModule cryptoOps = CryptoModuleFactory.getCryptoModule(cryptoModuleName);
+ org.apache.accumulo.core.security.crypto.CryptoModule cryptoOps = CryptoModuleFactory.getCryptoModule(cryptoModuleName);
@SuppressWarnings("deprecation")
InputStream decryptingInputStream = cryptoOps.getDecryptingInputStream(input, cryptoOpts);
Modified: accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/functional/PermissionsTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/functional/PermissionsTest.java?rev=1449493&r1=1449492&r2=1449493&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/functional/PermissionsTest.java (original)
+++ accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/functional/PermissionsTest.java Sun Feb 24 15:18:46 2013
@@ -46,7 +46,6 @@ 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.AuthenticationToken;
import org.apache.accumulo.core.security.tokens.PasswordToken;
import org.apache.accumulo.server.conf.ServerConfiguration;
import org.apache.hadoop.io.Text;
@@ -54,7 +53,7 @@ import org.apache.log4j.Logger;
public class PermissionsTest {
private static final String TEST_USER = "test_user";
- private static final AuthenticationToken TEST_PASS = new PasswordToken("test_password");
+ private static final PasswordToken TEST_PASS = new PasswordToken("test_password");
public static class SystemPermissionsTest extends FunctionalTest {
private static final Logger log = Logger.getLogger(SystemPermissionsTest.class);
@@ -78,7 +77,7 @@ public class PermissionsTest {
verifyHasOnlyTheseSystemPermissions(getConnector(), getConnector().whoami(), SystemPermission.values());
// create the test user
- getConnector().securityOperations().createUser(TEST_USER, TEST_PASS);
+ getConnector().securityOperations().createLocalUser(TEST_USER, TEST_PASS);
Connector test_user_conn = getInstance().getConnector(TEST_USER, TEST_PASS);
verifyHasNoSystemPermissions(getConnector(), TEST_USER, SystemPermission.values());
@@ -169,27 +168,27 @@ public class PermissionsTest {
case CREATE_USER:
user = "__CREATE_USER_WITHOUT_PERM_TEST__";
try {
- test_user_conn.securityOperations().createUser(user, new PasswordToken(password));
+ test_user_conn.securityOperations().createLocalUser(user, new PasswordToken(password));
throw new IllegalStateException("Should NOT be able to create a user");
} catch (AccumuloSecurityException e) {
- if (e.getErrorCode() != SecurityErrorCode.PERMISSION_DENIED || root_conn.securityOperations().authenticateUser(user, password.getBytes()))
+ if (e.getErrorCode() != SecurityErrorCode.PERMISSION_DENIED || root_conn.securityOperations().authenticateUser(user, new PasswordToken(password)))
throw e;
}
break;
case DROP_USER:
user = "__DROP_USER_WITHOUT_PERM_TEST__";
- root_conn.securityOperations().createUser(user, new PasswordToken(password));
+ root_conn.securityOperations().createLocalUser(user, new PasswordToken(password));
try {
- test_user_conn.securityOperations().dropUser(user);
+ test_user_conn.securityOperations().dropLocalUser(user);
throw new IllegalStateException("Should NOT be able to delete a user");
} catch (AccumuloSecurityException e) {
- if (e.getErrorCode() != SecurityErrorCode.PERMISSION_DENIED || !root_conn.securityOperations().authenticateUser(user, password.getBytes()))
+ if (e.getErrorCode() != SecurityErrorCode.PERMISSION_DENIED || !root_conn.securityOperations().authenticateUser(user, new PasswordToken(password)))
throw e;
}
break;
case ALTER_USER:
user = "__ALTER_USER_WITHOUT_PERM_TEST__";
- root_conn.securityOperations().createUser(user, new PasswordToken(password));
+ root_conn.securityOperations().createLocalUser(user, new PasswordToken(password));
try {
test_user_conn.securityOperations().changeUserAuthorizations(user, new Authorizations("A", "B"));
throw new IllegalStateException("Should NOT be able to alter a user");
@@ -244,20 +243,20 @@ public class PermissionsTest {
break;
case CREATE_USER:
user = "__CREATE_USER_WITH_PERM_TEST__";
- test_user_conn.securityOperations().createUser(user, new PasswordToken(password));
- if (!root_conn.securityOperations().authenticateUser(user, password.getBytes()))
+ test_user_conn.securityOperations().createLocalUser(user, new PasswordToken(password));
+ if (!root_conn.securityOperations().authenticateUser(user, new PasswordToken(password)))
throw new IllegalStateException("Should be able to create a user");
break;
case DROP_USER:
user = "__DROP_USER_WITH_PERM_TEST__";
- root_conn.securityOperations().createUser(user, new PasswordToken(password));
- test_user_conn.securityOperations().dropUser(user);
- if (root_conn.securityOperations().authenticateUser(user, password.getBytes()))
+ root_conn.securityOperations().createLocalUser(user, new PasswordToken(password));
+ test_user_conn.securityOperations().dropLocalUser(user);
+ if (root_conn.securityOperations().authenticateUser(user, new PasswordToken(password)))
throw new IllegalStateException("Should be able to delete a user");
break;
case ALTER_USER:
user = "__ALTER_USER_WITH_PERM_TEST__";
- root_conn.securityOperations().createUser(user, new PasswordToken(password));
+ root_conn.securityOperations().createLocalUser(user, new PasswordToken(password));
test_user_conn.securityOperations().changeUserAuthorizations(user, new Authorizations("A", "B"));
if (root_conn.securityOperations().getUserAuthorizations(user).isEmpty())
throw new IllegalStateException("Should be able to alter a user");
@@ -314,7 +313,7 @@ public class PermissionsTest {
@Override
public void run() throws AccumuloException, AccumuloSecurityException, TableExistsException, TableNotFoundException, MutationsRejectedException {
// create the test user
- getConnector().securityOperations().createUser(TEST_USER, TEST_PASS);
+ getConnector().securityOperations().createLocalUser(TEST_USER, TEST_PASS);
Connector test_user_conn = getInstance().getConnector(TEST_USER, TEST_PASS);
// check for read-only access to metadata table
Modified: accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CreateUser.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CreateUser.java?rev=1449493&r1=1449492&r2=1449493&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CreateUser.java (original)
+++ accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/CreateUser.java Sun Feb 24 15:18:46 2013
@@ -40,7 +40,7 @@ public class CreateUser extends Test {
try {
log.debug("Creating user " + userName);
- conn.securityOperations().createUser(userName, new PasswordToken(userName + "pass"));
+ conn.securityOperations().createLocalUser(userName, new PasswordToken(userName + "pass"));
} catch (AccumuloSecurityException ex) {
log.debug("Create user failed " + ex.getCause());
}
Modified: accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DropUser.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DropUser.java?rev=1449493&r1=1449492&r2=1449493&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DropUser.java (original)
+++ accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/concurrent/DropUser.java Sun Feb 24 15:18:46 2013
@@ -39,7 +39,7 @@ public class DropUser extends Test {
try {
log.debug("Dropping user " + userName);
- conn.securityOperations().dropUser(userName);
+ conn.securityOperations().dropLocalUser(userName);
} catch (AccumuloSecurityException ex) {
log.debug("Unable to drop " + ex.getCause());
}
Modified: accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Authenticate.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Authenticate.java?rev=1449493&r1=1449492&r2=1449493&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Authenticate.java (original)
+++ accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Authenticate.java Sun Feb 24 15:18:46 2013
@@ -23,6 +23,7 @@ import org.apache.accumulo.core.client.A
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.security.thrift.TCredentials;
+import org.apache.accumulo.core.security.tokens.PasswordToken;
import org.apache.accumulo.test.randomwalk.State;
import org.apache.accumulo.test.randomwalk.Test;
@@ -50,7 +51,7 @@ public class Authenticate extends Test {
// Copy so if failed it doesn't mess with the password stored in state
byte[] password = Arrays.copyOf(WalkingSecurity.get(state).getUserPassword(target), WalkingSecurity.get(state).getUserPassword(target).length);
boolean hasPermission = WalkingSecurity.get(state).canAskAboutUser(auth, target);
-
+
if (!success)
for (int i = 0; i < password.length; i++)
password[i]++;
@@ -58,7 +59,7 @@ public class Authenticate extends Test {
boolean result;
try {
- result = conn.securityOperations().authenticateUser(target, password);
+ result = conn.securityOperations().authenticateUser(target, new PasswordToken(password));
} catch (AccumuloSecurityException ae) {
switch (ae.getErrorCode()) {
case PERMISSION_DENIED:
Modified: accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/security/ChangePass.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/security/ChangePass.java?rev=1449493&r1=1449492&r2=1449493&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/security/ChangePass.java (original)
+++ accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/security/ChangePass.java Sun Feb 24 15:18:46 2013
@@ -23,7 +23,6 @@ import org.apache.accumulo.core.client.A
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.Connector;
import org.apache.accumulo.core.security.thrift.TCredentials;
-import org.apache.accumulo.core.security.tokens.AuthenticationToken;
import org.apache.accumulo.core.security.tokens.PasswordToken;
import org.apache.accumulo.test.randomwalk.State;
import org.apache.accumulo.test.randomwalk.Test;
@@ -60,9 +59,9 @@ public class ChangePass extends Test {
for (int i = 0; i < newPassw.length; i++)
newPassw[i] = (byte) ((r.nextInt(26) + 65) & 0xFF);
- AuthenticationToken newPass = new PasswordToken(newPassw);
+ PasswordToken newPass = new PasswordToken(newPassw);
try {
- conn.securityOperations().changeLoginInfo(target, newPass);
+ conn.securityOperations().changeLocalUserPassword(target, newPass);
} catch (AccumuloSecurityException ae) {
switch (ae.getErrorCode()) {
case PERMISSION_DENIED:
Modified: accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/security/CreateUser.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/security/CreateUser.java?rev=1449493&r1=1449492&r2=1449493&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/security/CreateUser.java (original)
+++ accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/security/CreateUser.java Sun Feb 24 15:18:46 2013
@@ -21,7 +21,6 @@ import java.util.Properties;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.Connector;
-import org.apache.accumulo.core.security.tokens.AuthenticationToken;
import org.apache.accumulo.core.security.tokens.PasswordToken;
import org.apache.accumulo.test.randomwalk.State;
import org.apache.accumulo.test.randomwalk.Test;
@@ -36,9 +35,9 @@ public class CreateUser extends Test {
boolean exists = WalkingSecurity.get(state).userExists(tableUserName);
boolean hasPermission = WalkingSecurity.get(state).canCreateUser(WalkingSecurity.get(state).getSysCredentials(), tableUserName);
- AuthenticationToken tabUserPass = new PasswordToken("Super Sekret Table User Password");
+ PasswordToken tabUserPass = new PasswordToken("Super Sekret Table User Password");
try {
- conn.securityOperations().createUser(tableUserName, tabUserPass);
+ conn.securityOperations().createLocalUser(tableUserName, tabUserPass);
} catch (AccumuloSecurityException ae) {
switch (ae.getErrorCode()) {
case PERMISSION_DENIED:
@@ -48,7 +47,7 @@ public class CreateUser extends Test {
// create user anyway for sake of state
{
if (!exists) {
- state.getConnector().securityOperations().createUser(tableUserName, tabUserPass);
+ state.getConnector().securityOperations().createLocalUser(tableUserName, tabUserPass);
WalkingSecurity.get(state).createUser(tableUserName, tabUserPass);
}
return;
Modified: accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/security/DropUser.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/security/DropUser.java?rev=1449493&r1=1449492&r2=1449493&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/security/DropUser.java (original)
+++ accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/security/DropUser.java Sun Feb 24 15:18:46 2013
@@ -36,7 +36,7 @@ public class DropUser extends Test {
boolean hasPermission = WalkingSecurity.get(state).canDropUser(WalkingSecurity.get(state).getSysCredentials(), tableUserName);
try {
- conn.securityOperations().dropUser(tableUserName);
+ conn.securityOperations().dropLocalUser(tableUserName);
} catch (AccumuloSecurityException ae) {
switch (ae.getErrorCode()) {
case PERMISSION_DENIED:
@@ -44,7 +44,7 @@ public class DropUser extends Test {
throw new AccumuloException("Got a security exception when I should have had permission.", ae);
else {
if (exists) {
- state.getConnector().securityOperations().dropUser(tableUserName);
+ state.getConnector().securityOperations().dropLocalUser(tableUserName);
WalkingSecurity.get(state).dropUser(tableUserName);
}
return;
Modified: accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SecurityFixture.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SecurityFixture.java?rev=1449493&r1=1449492&r2=1449493&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SecurityFixture.java (original)
+++ accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/security/SecurityFixture.java Sun Feb 24 15:18:46 2013
@@ -23,7 +23,6 @@ import org.apache.accumulo.core.client.C
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.AuthenticationToken;
import org.apache.accumulo.core.security.tokens.PasswordToken;
import org.apache.accumulo.test.randomwalk.Fixture;
import org.apache.accumulo.test.randomwalk.State;
@@ -43,14 +42,14 @@ public class SecurityFixture extends Fix
if (conn.tableOperations().exists(secTableName))
conn.tableOperations().delete(secTableName);
- Set<String> users = conn.securityOperations().listUsers();
+ Set<String> users = conn.securityOperations().listLocalUsers();
if (users.contains(tableUserName))
- conn.securityOperations().dropUser(tableUserName);
+ conn.securityOperations().dropLocalUser(tableUserName);
if (users.contains(systemUserName))
- conn.securityOperations().dropUser(systemUserName);
+ conn.securityOperations().dropLocalUser(systemUserName);
- AuthenticationToken sysUserPass = new PasswordToken("sysUser");
- conn.securityOperations().createUser(systemUserName, sysUserPass);
+ PasswordToken sysUserPass = new PasswordToken("sysUser");
+ conn.securityOperations().createLocalUser(systemUserName, sysUserPass);
WalkingSecurity.get(state).setTableName(secTableName);
state.set("rootUserPass", state.getCredentials().getToken());
@@ -90,11 +89,11 @@ public class SecurityFixture extends Fix
String tableUserName = WalkingSecurity.get(state).getTabUserName();
log.debug("Dropping user: " + tableUserName);
- conn.securityOperations().dropUser(tableUserName);
+ conn.securityOperations().dropLocalUser(tableUserName);
}
String systemUserName = WalkingSecurity.get(state).getSysUserName();
log.debug("Dropping user: " + systemUserName);
- conn.securityOperations().dropUser(systemUserName);
+ conn.securityOperations().dropLocalUser(systemUserName);
}
}
Modified: accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Validate.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Validate.java?rev=1449493&r1=1449492&r2=1449493&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Validate.java (original)
+++ accumulo/branches/ACCUMULO-259-polishing/test/src/main/java/org/apache/accumulo/test/randomwalk/security/Validate.java Sun Feb 24 15:18:46 2013
@@ -46,7 +46,7 @@ public class Validate extends Test {
throw new AccumuloException("Table existance out of sync");
boolean tableUserExists = WalkingSecurity.get(state).userExists(WalkingSecurity.get(state).getTabUserName());
- boolean cloudTableUserExists = conn.securityOperations().listUsers().contains(WalkingSecurity.get(state).getTabUserName());
+ boolean cloudTableUserExists = conn.securityOperations().listLocalUsers().contains(WalkingSecurity.get(state).getTabUserName());
if (tableUserExists != cloudTableUserExists)
throw new AccumuloException("Table User existance out of sync");
Modified: accumulo/branches/ACCUMULO-259-polishing/test/src/test/java/org/apache/accumulo/test/MiniAccumuloClusterTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/ACCUMULO-259-polishing/test/src/test/java/org/apache/accumulo/test/MiniAccumuloClusterTest.java?rev=1449493&r1=1449492&r2=1449493&view=diff
==============================================================================
--- accumulo/branches/ACCUMULO-259-polishing/test/src/test/java/org/apache/accumulo/test/MiniAccumuloClusterTest.java (original)
+++ accumulo/branches/ACCUMULO-259-polishing/test/src/test/java/org/apache/accumulo/test/MiniAccumuloClusterTest.java Sun Feb 24 15:18:46 2013
@@ -71,7 +71,7 @@ public class MiniAccumuloClusterTest {
conn.tableOperations().create("table1");
- conn.securityOperations().createUser("user1", new PasswordToken("pass1"));
+ conn.securityOperations().createLocalUser("user1", new PasswordToken("pass1"));
conn.securityOperations().changeUserAuthorizations("user1", new Authorizations("A", "B"));
conn.securityOperations().grantTablePermission("user1", "table1", TablePermission.WRITE);
conn.securityOperations().grantTablePermission("user1", "table1", TablePermission.READ);