You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by kt...@apache.org on 2013/04/18 03:34:37 UTC
svn commit: r1469120 [1/2] - in /accumulo/trunk: ./ assemble/
conf/examples/1GB/native-standalone/ conf/examples/1GB/standalone/
conf/examples/2GB/native-standalone/ conf/examples/2GB/standalone/
conf/examples/3GB/native-standalone/ conf/examples/3GB/s...
Author: kturner
Date: Thu Apr 18 01:34:36 2013
New Revision: 1469120
URL: http://svn.apache.org/r1469120
Log:
ACCUMULO-259 Simplified new API related to AuthenticationToken after discussion w/ Christopher and Eric
Added:
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/LoginProperties.java
- copied unchanged from r1469113, accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/util/LoginProperties.java
Removed:
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/security/handler/
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/LoginProperties.java
Modified:
accumulo/trunk/ (props changed)
accumulo/trunk/assemble/ (props changed)
accumulo/trunk/assemble/pom.xml
accumulo/trunk/conf/examples/1GB/native-standalone/accumulo-site.xml
accumulo/trunk/conf/examples/1GB/standalone/accumulo-site.xml
accumulo/trunk/conf/examples/2GB/native-standalone/accumulo-site.xml
accumulo/trunk/conf/examples/2GB/standalone/accumulo-site.xml
accumulo/trunk/conf/examples/3GB/native-standalone/accumulo-site.xml
accumulo/trunk/conf/examples/3GB/standalone/accumulo-site.xml
accumulo/trunk/conf/examples/512MB/native-standalone/accumulo-site.xml
accumulo/trunk/conf/examples/512MB/standalone/accumulo-site.xml
accumulo/trunk/core/ (props changed)
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/Instance.java
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ClientService.java
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstance.java
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/security/tokens/AuthenticationToken.java
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/security/tokens/NullToken.java
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/security/tokens/PasswordToken.java
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/conf/Property.java
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/ShellOptions.java
accumulo/trunk/core/src/main/thrift/client.thrift
accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java
accumulo/trunk/examples/ (props changed)
accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java (props changed)
accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java (props changed)
accumulo/trunk/pom.xml (props changed)
accumulo/trunk/proxy/proxy.properties
accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java
accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java
accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyInstanceOperations.java
accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyReadWrite.java
accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxySecurityOperations.java
accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyTableOperations.java
accumulo/trunk/server/ (props changed)
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/Accumulo.java
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/client/ClientServiceHandler.java
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/monitor/servlets/trace/Basic.java
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/security/SecurityOperation.java
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/security/handler/Authenticator.java
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/security/handler/InsecureAuthenticator.java
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/security/handler/ZKAuthenticator.java
accumulo/trunk/server/src/main/java/org/apache/accumulo/server/trace/TraceServer.java
accumulo/trunk/src/ (props changed)
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/MiniAccumuloCluster.java
accumulo/trunk/test/src/main/java/org/apache/accumulo/test/randomwalk/security/WalkingSecurity.java
Propchange: accumulo/trunk/
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5:r1469113
Propchange: accumulo/trunk/assemble/
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5/assemble:r1469113
Modified: accumulo/trunk/assemble/pom.xml
URL: http://svn.apache.org/viewvc/accumulo/trunk/assemble/pom.xml?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/assemble/pom.xml (original)
+++ accumulo/trunk/assemble/pom.xml Thu Apr 18 01:34:36 2013
@@ -458,5 +458,50 @@
</plugins>
</build>
</profile>
+ <profile>
+ <!-- profile for building against Hadoop 1.0.x
+ Activate by not specifying hadoop.profile -->
+ <id>hadoop-1.0</id>
+ <activation>
+ <property>
+ <name>!hadoop.profile</name>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-core</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ <profile>
+ <!-- profile for building against Hadoop 2.0.x
+ Activate using: mvn -Dhadoop.profile=2.0 -->
+ <id>hadoop-2.0</id>
+ <activation>
+ <property>
+ <name>hadoop.profile</name>
+ <value>2.0</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.avro</groupId>
+ <artifactId>avro</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-client</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-common</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ </profile>
</profiles>
</project>
Modified: accumulo/trunk/conf/examples/1GB/native-standalone/accumulo-site.xml
URL: http://svn.apache.org/viewvc/accumulo/trunk/conf/examples/1GB/native-standalone/accumulo-site.xml?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/conf/examples/1GB/native-standalone/accumulo-site.xml (original)
+++ accumulo/trunk/conf/examples/1GB/native-standalone/accumulo-site.xml Thu Apr 18 01:34:36 2013
@@ -59,13 +59,13 @@
</property>
<property>
- <name>trace.login.password</name>
+ <name>trace.token.property.password</name>
<!-- change this to the root user's password, and/or change the user below -->
<value>secret</value>
</property>
<property>
- <name>trace.principal</name>
+ <name>trace.user</name>
<value>root</value>
</property>
Modified: accumulo/trunk/conf/examples/1GB/standalone/accumulo-site.xml
URL: http://svn.apache.org/viewvc/accumulo/trunk/conf/examples/1GB/standalone/accumulo-site.xml?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/conf/examples/1GB/standalone/accumulo-site.xml (original)
+++ accumulo/trunk/conf/examples/1GB/standalone/accumulo-site.xml Thu Apr 18 01:34:36 2013
@@ -59,13 +59,13 @@
</property>
<property>
- <name>trace.login.password</name>
+ <name>trace.token.property.password</name>
<!-- change this to the root user's password, and/or change the user below -->
<value>secret</value>
</property>
<property>
- <name>trace.principal</name>
+ <name>trace.user</name>
<value>root</value>
</property>
Modified: accumulo/trunk/conf/examples/2GB/native-standalone/accumulo-site.xml
URL: http://svn.apache.org/viewvc/accumulo/trunk/conf/examples/2GB/native-standalone/accumulo-site.xml?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/conf/examples/2GB/native-standalone/accumulo-site.xml (original)
+++ accumulo/trunk/conf/examples/2GB/native-standalone/accumulo-site.xml Thu Apr 18 01:34:36 2013
@@ -59,13 +59,13 @@
</property>
<property>
- <name>trace.login.password</name>
+ <name>trace.token.property.password</name>
<!-- change this to the root user's password, and/or change the user below -->
<value>secret</value>
</property>
<property>
- <name>trace.principal</name>
+ <name>trace.user</name>
<value>root</value>
</property>
Modified: accumulo/trunk/conf/examples/2GB/standalone/accumulo-site.xml
URL: http://svn.apache.org/viewvc/accumulo/trunk/conf/examples/2GB/standalone/accumulo-site.xml?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/conf/examples/2GB/standalone/accumulo-site.xml (original)
+++ accumulo/trunk/conf/examples/2GB/standalone/accumulo-site.xml Thu Apr 18 01:34:36 2013
@@ -65,7 +65,7 @@
</property>
<property>
- <name>trace.login.password</name>
+ <name>trace.token.property.password</name>
<!--
change this to the root user's password, and/or change the user below
-->
@@ -73,7 +73,7 @@
</property>
<property>
- <name>trace.principal</name>
+ <name>trace.user</name>
<value>root</value>
</property>
Modified: accumulo/trunk/conf/examples/3GB/native-standalone/accumulo-site.xml
URL: http://svn.apache.org/viewvc/accumulo/trunk/conf/examples/3GB/native-standalone/accumulo-site.xml?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/conf/examples/3GB/native-standalone/accumulo-site.xml (original)
+++ accumulo/trunk/conf/examples/3GB/native-standalone/accumulo-site.xml Thu Apr 18 01:34:36 2013
@@ -59,13 +59,13 @@
</property>
<property>
- <name>trace.login.password</name>
+ <name>trace.token.property.password</name>
<!-- change this to the root user's password, and/or change the user below -->
<value>secret</value>
</property>
<property>
- <name>trace.principal</name>
+ <name>trace.user</name>
<value>root</value>
</property>
Modified: accumulo/trunk/conf/examples/3GB/standalone/accumulo-site.xml
URL: http://svn.apache.org/viewvc/accumulo/trunk/conf/examples/3GB/standalone/accumulo-site.xml?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/conf/examples/3GB/standalone/accumulo-site.xml (original)
+++ accumulo/trunk/conf/examples/3GB/standalone/accumulo-site.xml Thu Apr 18 01:34:36 2013
@@ -59,13 +59,13 @@
</property>
<property>
- <name>trace.login.password</name>
+ <name>trace.token.property.password</name>
<!-- change this to the root user's password, and/or change the user below -->
<value>secret</value>
</property>
<property>
- <name>trace.principal</name>
+ <name>trace.user</name>
<value>root</value>
</property>
Modified: accumulo/trunk/conf/examples/512MB/native-standalone/accumulo-site.xml
URL: http://svn.apache.org/viewvc/accumulo/trunk/conf/examples/512MB/native-standalone/accumulo-site.xml?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/conf/examples/512MB/native-standalone/accumulo-site.xml (original)
+++ accumulo/trunk/conf/examples/512MB/native-standalone/accumulo-site.xml Thu Apr 18 01:34:36 2013
@@ -59,13 +59,13 @@
</property>
<property>
- <name>trace.login.password</name>
+ <name>trace.token.property.password</name>
<!-- change this to the root user's password, and/or change the user below -->
<value>secret</value>
</property>
<property>
- <name>trace.principal</name>
+ <name>trace.user</name>
<value>root</value>
</property>
Modified: accumulo/trunk/conf/examples/512MB/standalone/accumulo-site.xml
URL: http://svn.apache.org/viewvc/accumulo/trunk/conf/examples/512MB/standalone/accumulo-site.xml?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/conf/examples/512MB/standalone/accumulo-site.xml (original)
+++ accumulo/trunk/conf/examples/512MB/standalone/accumulo-site.xml Thu Apr 18 01:34:36 2013
@@ -63,13 +63,13 @@
</property>
<property>
- <name>trace.login.password</name>
+ <name>trace.token.property.password</name>
<!-- change this to the root user's password, and/or change the user below -->
<value>secret</value>
</property>
<property>
- <name>trace.principal</name>
+ <name>trace.user</name>
<value>root</value>
</property>
Propchange: accumulo/trunk/core/
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5/core:r1469113
Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/cli/ClientOpts.java Thu Apr 18 01:34:36 2013
@@ -112,10 +112,14 @@ public class ClientOpts extends Help {
@Parameter(names = "--password", converter = PasswordConverter.class, description = "Enter the connection password", password = true)
public Password securePassword = null;
+ @Parameter(names = {"-tc", "--tokenClass"}, description = "Token class")
+ public String tokenClassName = PasswordToken.class.getName();
+
@DynamicParameter(names = "-l",
description = "login properties in the format key=value. Reuse -l for each property (prompt for properties if this option is missing")
public Map<String,String> loginProps = new LinkedHashMap<String,String>();
+
public AuthenticationToken getToken() {
if (!loginProps.isEmpty()) {
Properties props = new Properties();
@@ -123,12 +127,13 @@ public class ClientOpts extends Help {
props.put(loginOption.getKey(), loginOption.getValue());
try {
- return getInstance().getAuthenticator().login(principal, props);
- } catch (AccumuloSecurityException e) {
- throw new RuntimeException(e);
- } catch (AccumuloException e) {
+ AuthenticationToken token = Class.forName(tokenClassName).asSubclass(AuthenticationToken.class).newInstance();
+ token.init(props);
+ return token;
+ } catch (Exception e) {
throw new RuntimeException(e);
}
+
}
if (securePassword != null)
Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/Instance.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/Instance.java?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/Instance.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/Instance.java Thu Apr 18 01:34:36 2013
@@ -18,11 +18,10 @@ package org.apache.accumulo.core.client;
import java.nio.ByteBuffer;
import java.util.List;
-import java.util.Properties;
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
+import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
-import org.apache.accumulo.core.security.handler.Authenticator;
/**
* This class represents the information a client needs to know to connect to an instance of accumulo.
@@ -83,7 +82,7 @@ public interface Instance {
* when a generic exception occurs
* @throws AccumuloSecurityException
* when a user's credentials are invalid
- * @deprecated since 1.5, use {@link #getConnector(String, Properties)}
+ * @deprecated since 1.5, use {@link #getConnector(String, AuthenticationToken)} with {@link PasswordToken}
*/
@Deprecated
public abstract Connector getConnector(String user, byte[] pass) throws AccumuloException, AccumuloSecurityException;
@@ -98,7 +97,7 @@ public interface Instance {
* when a generic exception occurs
* @throws AccumuloSecurityException
* when a user's credentials are invalid
- * @deprecated since 1.5, use {@link #getConnector(String, Properties)}
+ * @deprecated since 1.5, use {@link #getConnector(String, AuthenticationToken)} with {@link PasswordToken}
*/
@Deprecated
public abstract Connector getConnector(org.apache.accumulo.core.security.thrift.AuthInfo auth) throws AccumuloException, AccumuloSecurityException;
@@ -115,7 +114,7 @@ public interface Instance {
* when a generic exception occurs
* @throws AccumuloSecurityException
* when a user's credentials are invalid
- * @deprecated since 1.5, use {@link #getConnector(String, Properties)}
+ * @deprecated since 1.5, use {@link #getConnector(String, AuthenticationToken)} with {@link PasswordToken}
*/
@Deprecated
public abstract Connector getConnector(String user, ByteBuffer pass) throws AccumuloException, AccumuloSecurityException;
@@ -132,7 +131,7 @@ public interface Instance {
* when a generic exception occurs
* @throws AccumuloSecurityException
* when a user's credentials are invalid
- * @deprecated since 1.5, use {@link #getConnector(String, Properties)}
+ * @deprecated since 1.5, use {@link #getConnector(String, AuthenticationToken)} with {@link PasswordToken}
*/
@Deprecated
public abstract Connector getConnector(String user, CharSequence pass) throws AccumuloException, AccumuloSecurityException;
@@ -153,42 +152,15 @@ public interface Instance {
public abstract void setConfiguration(AccumuloConfiguration conf);
/**
- * @return the canonical name of the helper class for the security token from the authenticator, if one exists.
- * @throws AccumuloException
- * @throws AccumuloSecurityException
- * @since 1.5.0
- */
- public abstract String getAuthenticatorClassName() throws AccumuloException, AccumuloSecurityException;
-
- /**
+ * Returns a connection to this instance of accumulo.
+ *
* @param principal
+ * a valid accumulo user
* @param token
- * A known SecurityToken type. If uncertain which should be provided, use {@link #getAuthenticatorClassName()} and
- * {@link Authenticator#login(String, Properties)}
- * @throws AccumuloException
- * @throws AccumuloSecurityException
- * @since 1.5.0
- */
- Connector getConnector(String principal, AuthenticationToken token) throws AccumuloException, AccumuloSecurityException;
-
- /**
- * @param principal
- * The principal the authentication token corresponds to
- * @param props
- * The properties necessary to construct an AuthenticationToken in the current security configuration
- * @throws AccumuloException
- * @throws AccumuloSecurityException
+ * Use the token type configured for the Accumulo instance you are connecting to. An Accumulo instance with default configurations will use
+ * {@link PasswordToken}
* @since 1.5.0
*/
- Connector getConnector(String principal, Properties props) throws AccumuloException, AccumuloSecurityException;
+ public abstract Connector getConnector(String principal, AuthenticationToken token) throws AccumuloException, AccumuloSecurityException;
- /**
- *
- * @return Returns the corresponding Authenticator class, which can be used to create a token ({@link Authenticator#login(String, Properties)} or get a list of
- * required properties {@link Authenticator#getProperties()}
- * @throws AccumuloException
- * @throws AccumuloSecurityException
- * @since 1.5.0
- */
- Authenticator getAuthenticator() throws AccumuloException, AccumuloSecurityException;
}
Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java Thu Apr 18 01:34:36 2013
@@ -21,21 +21,16 @@ import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Collections;
import java.util.List;
-import java.util.Properties;
import java.util.UUID;
import org.apache.accumulo.core.Constants;
-import org.apache.accumulo.core.client.impl.ClientExecReturn;
import org.apache.accumulo.core.client.impl.ConnectorImpl;
-import org.apache.accumulo.core.client.impl.ServerClient;
-import org.apache.accumulo.core.client.impl.thrift.ClientService;
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.file.FileUtil;
import org.apache.accumulo.core.security.CredentialHelper;
-import org.apache.accumulo.core.security.handler.Authenticator;
import org.apache.accumulo.core.security.thrift.TCredentials;
import org.apache.accumulo.core.util.ArgumentChecker;
import org.apache.accumulo.core.util.ByteBufferUtil;
@@ -232,12 +227,6 @@ public class ZooKeeperInstance implement
return new ConnectorImpl(this, credential);
}
- public Connector getConnector(String principal, Properties props) throws AccumuloException, AccumuloSecurityException {
- Authenticator authenticator = getAuthenticator();
- AuthenticationToken authToken = authenticator.login(principal, props);
- return getConnector(principal, authToken);
- }
-
@Override
@Deprecated
public Connector getConnector(String principal, byte[] pass) throws AccumuloException, AccumuloSecurityException {
@@ -319,31 +308,4 @@ public class ZooKeeperInstance implement
public Connector getConnector(org.apache.accumulo.core.security.thrift.AuthInfo auth) throws AccumuloException, AccumuloSecurityException {
return getConnector(auth.user, auth.password);
}
-
- @Override
- public String getAuthenticatorClassName() throws AccumuloException, AccumuloSecurityException {
- return ServerClient.execute(this, new ClientExecReturn<String,ClientService.Client>() {
- @Override
- public String execute(ClientService.Client iface) throws Exception {
- return iface.getAuthenticatorClassName();
- }
- });
- }
-
- @Override
- public Authenticator getAuthenticator() throws AccumuloException, AccumuloSecurityException {
- String authenticatorName = getAuthenticatorClassName();
- try {
- Class<?> clazz = Class.forName(authenticatorName);
- Class<? extends Authenticator> authClass = clazz.asSubclass(Authenticator.class);
- Authenticator authenticator = authClass.newInstance();
- return authenticator;
- } catch (ClassNotFoundException e) {
- throw new AccumuloException(e);
- } catch (InstantiationException e) {
- throw new AccumuloException(e);
- } catch (IllegalAccessException e) {
- throw new AccumuloException(e);
- }
- }
}
Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ClientService.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ClientService.java?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ClientService.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/impl/thrift/ClientService.java Thu Apr 18 01:34:36 2013
@@ -70,8 +70,6 @@ import org.slf4j.LoggerFactory;
public void changeLocalUserPassword(org.apache.accumulo.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, String principal, ByteBuffer password) throws ThriftSecurityException, org.apache.thrift.TException;
- public String getAuthenticatorClassName() throws ThriftSecurityException, org.apache.thrift.TException;
-
public boolean authenticate(org.apache.accumulo.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials) throws ThriftSecurityException, org.apache.thrift.TException;
public boolean authenticateUser(org.apache.accumulo.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, org.apache.accumulo.core.security.thrift.TCredentials toAuth) throws ThriftSecurityException, org.apache.thrift.TException;
@@ -122,8 +120,6 @@ import org.slf4j.LoggerFactory;
public void changeLocalUserPassword(org.apache.accumulo.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, String principal, ByteBuffer password, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.changeLocalUserPassword_call> resultHandler) throws org.apache.thrift.TException;
- public void getAuthenticatorClassName(org.apache.thrift.async.AsyncMethodCallback<AsyncClient.getAuthenticatorClassName_call> resultHandler) throws org.apache.thrift.TException;
-
public void authenticate(org.apache.accumulo.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.authenticate_call> resultHandler) throws org.apache.thrift.TException;
public void authenticateUser(org.apache.accumulo.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, org.apache.accumulo.core.security.thrift.TCredentials toAuth, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.authenticateUser_call> resultHandler) throws org.apache.thrift.TException;
@@ -424,31 +420,6 @@ import org.slf4j.LoggerFactory;
return;
}
- public String getAuthenticatorClassName() throws ThriftSecurityException, org.apache.thrift.TException
- {
- send_getAuthenticatorClassName();
- return recv_getAuthenticatorClassName();
- }
-
- public void send_getAuthenticatorClassName() throws org.apache.thrift.TException
- {
- getAuthenticatorClassName_args args = new getAuthenticatorClassName_args();
- sendBase("getAuthenticatorClassName", args);
- }
-
- public String recv_getAuthenticatorClassName() throws ThriftSecurityException, org.apache.thrift.TException
- {
- getAuthenticatorClassName_result result = new getAuthenticatorClassName_result();
- receiveBase(result, "getAuthenticatorClassName");
- if (result.isSetSuccess()) {
- return result.success;
- }
- if (result.tse != null) {
- throw result.tse;
- }
- throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAuthenticatorClassName failed: unknown result");
- }
-
public boolean authenticate(org.apache.accumulo.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials) throws ThriftSecurityException, org.apache.thrift.TException
{
send_authenticate(tinfo, credentials);
@@ -1188,35 +1159,6 @@ import org.slf4j.LoggerFactory;
}
}
- public void getAuthenticatorClassName(org.apache.thrift.async.AsyncMethodCallback<getAuthenticatorClassName_call> resultHandler) throws org.apache.thrift.TException {
- checkReady();
- getAuthenticatorClassName_call method_call = new getAuthenticatorClassName_call(resultHandler, this, ___protocolFactory, ___transport);
- this.___currentMethod = method_call;
- ___manager.call(method_call);
- }
-
- public static class getAuthenticatorClassName_call extends org.apache.thrift.async.TAsyncMethodCall {
- public getAuthenticatorClassName_call(org.apache.thrift.async.AsyncMethodCallback<getAuthenticatorClassName_call> resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
- super(client, protocolFactory, transport, resultHandler, false);
- }
-
- public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
- prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAuthenticatorClassName", org.apache.thrift.protocol.TMessageType.CALL, 0));
- getAuthenticatorClassName_args args = new getAuthenticatorClassName_args();
- args.write(prot);
- prot.writeMessageEnd();
- }
-
- public String getResult() throws ThriftSecurityException, org.apache.thrift.TException {
- if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
- throw new IllegalStateException("Method call not finished!");
- }
- org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
- org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
- return (new Client(prot)).recv_getAuthenticatorClassName();
- }
- }
-
public void authenticate(org.apache.accumulo.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, org.apache.thrift.async.AsyncMethodCallback<authenticate_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
authenticate_call method_call = new authenticate_call(tinfo, credentials, resultHandler, this, ___protocolFactory, ___transport);
@@ -1764,7 +1706,6 @@ import org.slf4j.LoggerFactory;
processMap.put("createLocalUser", new createLocalUser());
processMap.put("dropLocalUser", new dropLocalUser());
processMap.put("changeLocalUserPassword", new changeLocalUserPassword());
- processMap.put("getAuthenticatorClassName", new getAuthenticatorClassName());
processMap.put("authenticate", new authenticate());
processMap.put("authenticateUser", new authenticateUser());
processMap.put("changeAuthorizations", new changeAuthorizations());
@@ -2008,30 +1949,6 @@ import org.slf4j.LoggerFactory;
}
}
- public static class getAuthenticatorClassName<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAuthenticatorClassName_args> {
- public getAuthenticatorClassName() {
- super("getAuthenticatorClassName");
- }
-
- public getAuthenticatorClassName_args getEmptyArgsInstance() {
- return new getAuthenticatorClassName_args();
- }
-
- protected boolean isOneway() {
- return false;
- }
-
- public getAuthenticatorClassName_result getResult(I iface, getAuthenticatorClassName_args args) throws org.apache.thrift.TException {
- getAuthenticatorClassName_result result = new getAuthenticatorClassName_result();
- try {
- result.success = iface.getAuthenticatorClassName();
- } catch (ThriftSecurityException tse) {
- result.tse = tse;
- }
- return result;
- }
- }
-
public static class authenticate<I extends Iface> extends org.apache.thrift.ProcessFunction<I, authenticate_args> {
public authenticate() {
super("authenticate");
@@ -11247,708 +11164,6 @@ import org.slf4j.LoggerFactory;
}
- public static class getAuthenticatorClassName_args implements org.apache.thrift.TBase<getAuthenticatorClassName_args, getAuthenticatorClassName_args._Fields>, java.io.Serializable, Cloneable {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAuthenticatorClassName_args");
-
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new getAuthenticatorClassName_argsStandardSchemeFactory());
- schemes.put(TupleScheme.class, new getAuthenticatorClassName_argsTupleSchemeFactory());
- }
-
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
-;
-
- private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
- public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
- static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAuthenticatorClassName_args.class, metaDataMap);
- }
-
- public getAuthenticatorClassName_args() {
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public getAuthenticatorClassName_args(getAuthenticatorClassName_args other) {
- }
-
- public getAuthenticatorClassName_args deepCopy() {
- return new getAuthenticatorClassName_args(this);
- }
-
- @Override
- public void clear() {
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- }
- throw new IllegalStateException();
- }
-
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
-
- switch (field) {
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof getAuthenticatorClassName_args)
- return this.equals((getAuthenticatorClassName_args)that);
- return false;
- }
-
- public boolean equals(getAuthenticatorClassName_args that) {
- if (that == null)
- return false;
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- public int compareTo(getAuthenticatorClassName_args other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
- getAuthenticatorClassName_args typedOther = (getAuthenticatorClassName_args)other;
-
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("getAuthenticatorClassName_args(");
- boolean first = true;
-
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- // check for sub-struct validity
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class getAuthenticatorClassName_argsStandardSchemeFactory implements SchemeFactory {
- public getAuthenticatorClassName_argsStandardScheme getScheme() {
- return new getAuthenticatorClassName_argsStandardScheme();
- }
- }
-
- private static class getAuthenticatorClassName_argsStandardScheme extends StandardScheme<getAuthenticatorClassName_args> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, getAuthenticatorClassName_args struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, getAuthenticatorClassName_args struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class getAuthenticatorClassName_argsTupleSchemeFactory implements SchemeFactory {
- public getAuthenticatorClassName_argsTupleScheme getScheme() {
- return new getAuthenticatorClassName_argsTupleScheme();
- }
- }
-
- private static class getAuthenticatorClassName_argsTupleScheme extends TupleScheme<getAuthenticatorClassName_args> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, getAuthenticatorClassName_args struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, getAuthenticatorClassName_args struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- }
- }
-
- }
-
- public static class getAuthenticatorClassName_result implements org.apache.thrift.TBase<getAuthenticatorClassName_result, getAuthenticatorClassName_result._Fields>, java.io.Serializable, Cloneable {
- private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAuthenticatorClassName_result");
-
- private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
- private static final org.apache.thrift.protocol.TField TSE_FIELD_DESC = new org.apache.thrift.protocol.TField("tse", org.apache.thrift.protocol.TType.STRUCT, (short)1);
-
- private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
- static {
- schemes.put(StandardScheme.class, new getAuthenticatorClassName_resultStandardSchemeFactory());
- schemes.put(TupleScheme.class, new getAuthenticatorClassName_resultTupleSchemeFactory());
- }
-
- public String success; // required
- public ThriftSecurityException tse; // required
-
- /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
- @SuppressWarnings("all") public enum _Fields implements org.apache.thrift.TFieldIdEnum {
- SUCCESS((short)0, "success"),
- TSE((short)1, "tse");
-
- private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
-
- static {
- for (_Fields field : EnumSet.allOf(_Fields.class)) {
- byName.put(field.getFieldName(), field);
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, or null if its not found.
- */
- public static _Fields findByThriftId(int fieldId) {
- switch(fieldId) {
- case 0: // SUCCESS
- return SUCCESS;
- case 1: // TSE
- return TSE;
- default:
- return null;
- }
- }
-
- /**
- * Find the _Fields constant that matches fieldId, throwing an exception
- * if it is not found.
- */
- public static _Fields findByThriftIdOrThrow(int fieldId) {
- _Fields fields = findByThriftId(fieldId);
- if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
- return fields;
- }
-
- /**
- * Find the _Fields constant that matches name, or null if its not found.
- */
- public static _Fields findByName(String name) {
- return byName.get(name);
- }
-
- private final short _thriftId;
- private final String _fieldName;
-
- _Fields(short thriftId, String fieldName) {
- _thriftId = thriftId;
- _fieldName = fieldName;
- }
-
- public short getThriftFieldId() {
- return _thriftId;
- }
-
- public String getFieldName() {
- return _fieldName;
- }
- }
-
- // isset id assignments
- public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
- static {
- Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
- tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
- tmpMap.put(_Fields.TSE, new org.apache.thrift.meta_data.FieldMetaData("tse", org.apache.thrift.TFieldRequirementType.DEFAULT,
- new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));
- metaDataMap = Collections.unmodifiableMap(tmpMap);
- org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAuthenticatorClassName_result.class, metaDataMap);
- }
-
- public getAuthenticatorClassName_result() {
- }
-
- public getAuthenticatorClassName_result(
- String success,
- ThriftSecurityException tse)
- {
- this();
- this.success = success;
- this.tse = tse;
- }
-
- /**
- * Performs a deep copy on <i>other</i>.
- */
- public getAuthenticatorClassName_result(getAuthenticatorClassName_result other) {
- if (other.isSetSuccess()) {
- this.success = other.success;
- }
- if (other.isSetTse()) {
- this.tse = new ThriftSecurityException(other.tse);
- }
- }
-
- public getAuthenticatorClassName_result deepCopy() {
- return new getAuthenticatorClassName_result(this);
- }
-
- @Override
- public void clear() {
- this.success = null;
- this.tse = null;
- }
-
- public String getSuccess() {
- return this.success;
- }
-
- public getAuthenticatorClassName_result setSuccess(String success) {
- this.success = success;
- return this;
- }
-
- public void unsetSuccess() {
- this.success = null;
- }
-
- /** Returns true if field success is set (has been assigned a value) and false otherwise */
- public boolean isSetSuccess() {
- return this.success != null;
- }
-
- public void setSuccessIsSet(boolean value) {
- if (!value) {
- this.success = null;
- }
- }
-
- public ThriftSecurityException getTse() {
- return this.tse;
- }
-
- public getAuthenticatorClassName_result setTse(ThriftSecurityException tse) {
- this.tse = tse;
- return this;
- }
-
- public void unsetTse() {
- this.tse = null;
- }
-
- /** Returns true if field tse is set (has been assigned a value) and false otherwise */
- public boolean isSetTse() {
- return this.tse != null;
- }
-
- public void setTseIsSet(boolean value) {
- if (!value) {
- this.tse = null;
- }
- }
-
- public void setFieldValue(_Fields field, Object value) {
- switch (field) {
- case SUCCESS:
- if (value == null) {
- unsetSuccess();
- } else {
- setSuccess((String)value);
- }
- break;
-
- case TSE:
- if (value == null) {
- unsetTse();
- } else {
- setTse((ThriftSecurityException)value);
- }
- break;
-
- }
- }
-
- public Object getFieldValue(_Fields field) {
- switch (field) {
- case SUCCESS:
- return getSuccess();
-
- case TSE:
- return getTse();
-
- }
- throw new IllegalStateException();
- }
-
- /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
- public boolean isSet(_Fields field) {
- if (field == null) {
- throw new IllegalArgumentException();
- }
-
- switch (field) {
- case SUCCESS:
- return isSetSuccess();
- case TSE:
- return isSetTse();
- }
- throw new IllegalStateException();
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- if (that instanceof getAuthenticatorClassName_result)
- return this.equals((getAuthenticatorClassName_result)that);
- return false;
- }
-
- public boolean equals(getAuthenticatorClassName_result that) {
- if (that == null)
- return false;
-
- boolean this_present_success = true && this.isSetSuccess();
- boolean that_present_success = true && that.isSetSuccess();
- if (this_present_success || that_present_success) {
- if (!(this_present_success && that_present_success))
- return false;
- if (!this.success.equals(that.success))
- return false;
- }
-
- boolean this_present_tse = true && this.isSetTse();
- boolean that_present_tse = true && that.isSetTse();
- if (this_present_tse || that_present_tse) {
- if (!(this_present_tse && that_present_tse))
- return false;
- if (!this.tse.equals(that.tse))
- return false;
- }
-
- return true;
- }
-
- @Override
- public int hashCode() {
- return 0;
- }
-
- public int compareTo(getAuthenticatorClassName_result other) {
- if (!getClass().equals(other.getClass())) {
- return getClass().getName().compareTo(other.getClass().getName());
- }
-
- int lastComparison = 0;
- getAuthenticatorClassName_result typedOther = (getAuthenticatorClassName_result)other;
-
- lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetSuccess()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- lastComparison = Boolean.valueOf(isSetTse()).compareTo(typedOther.isSetTse());
- if (lastComparison != 0) {
- return lastComparison;
- }
- if (isSetTse()) {
- lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tse, typedOther.tse);
- if (lastComparison != 0) {
- return lastComparison;
- }
- }
- return 0;
- }
-
- public _Fields fieldForId(int fieldId) {
- return _Fields.findByThriftId(fieldId);
- }
-
- public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
- schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
- schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("getAuthenticatorClassName_result(");
- boolean first = true;
-
- sb.append("success:");
- if (this.success == null) {
- sb.append("null");
- } else {
- sb.append(this.success);
- }
- first = false;
- if (!first) sb.append(", ");
- sb.append("tse:");
- if (this.tse == null) {
- sb.append("null");
- } else {
- sb.append(this.tse);
- }
- first = false;
- sb.append(")");
- return sb.toString();
- }
-
- public void validate() throws org.apache.thrift.TException {
- // check for required fields
- // check for sub-struct validity
- }
-
- private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
- try {
- write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
- try {
- read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
- } catch (org.apache.thrift.TException te) {
- throw new java.io.IOException(te);
- }
- }
-
- private static class getAuthenticatorClassName_resultStandardSchemeFactory implements SchemeFactory {
- public getAuthenticatorClassName_resultStandardScheme getScheme() {
- return new getAuthenticatorClassName_resultStandardScheme();
- }
- }
-
- private static class getAuthenticatorClassName_resultStandardScheme extends StandardScheme<getAuthenticatorClassName_result> {
-
- public void read(org.apache.thrift.protocol.TProtocol iprot, getAuthenticatorClassName_result struct) throws org.apache.thrift.TException {
- org.apache.thrift.protocol.TField schemeField;
- iprot.readStructBegin();
- while (true)
- {
- schemeField = iprot.readFieldBegin();
- if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
- break;
- }
- switch (schemeField.id) {
- case 0: // SUCCESS
- if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
- struct.success = iprot.readString();
- struct.setSuccessIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- case 1: // TSE
- if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
- struct.tse = new ThriftSecurityException();
- struct.tse.read(iprot);
- struct.setTseIsSet(true);
- } else {
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- break;
- default:
- org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
- }
- iprot.readFieldEnd();
- }
- iprot.readStructEnd();
-
- // check for required fields of primitive type, which can't be checked in the validate method
- struct.validate();
- }
-
- public void write(org.apache.thrift.protocol.TProtocol oprot, getAuthenticatorClassName_result struct) throws org.apache.thrift.TException {
- struct.validate();
-
- oprot.writeStructBegin(STRUCT_DESC);
- if (struct.success != null) {
- oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
- oprot.writeString(struct.success);
- oprot.writeFieldEnd();
- }
- if (struct.tse != null) {
- oprot.writeFieldBegin(TSE_FIELD_DESC);
- struct.tse.write(oprot);
- oprot.writeFieldEnd();
- }
- oprot.writeFieldStop();
- oprot.writeStructEnd();
- }
-
- }
-
- private static class getAuthenticatorClassName_resultTupleSchemeFactory implements SchemeFactory {
- public getAuthenticatorClassName_resultTupleScheme getScheme() {
- return new getAuthenticatorClassName_resultTupleScheme();
- }
- }
-
- private static class getAuthenticatorClassName_resultTupleScheme extends TupleScheme<getAuthenticatorClassName_result> {
-
- @Override
- public void write(org.apache.thrift.protocol.TProtocol prot, getAuthenticatorClassName_result struct) throws org.apache.thrift.TException {
- TTupleProtocol oprot = (TTupleProtocol) prot;
- BitSet optionals = new BitSet();
- if (struct.isSetSuccess()) {
- optionals.set(0);
- }
- if (struct.isSetTse()) {
- optionals.set(1);
- }
- oprot.writeBitSet(optionals, 2);
- if (struct.isSetSuccess()) {
- oprot.writeString(struct.success);
- }
- if (struct.isSetTse()) {
- struct.tse.write(oprot);
- }
- }
-
- @Override
- public void read(org.apache.thrift.protocol.TProtocol prot, getAuthenticatorClassName_result struct) throws org.apache.thrift.TException {
- TTupleProtocol iprot = (TTupleProtocol) prot;
- BitSet incoming = iprot.readBitSet(2);
- if (incoming.get(0)) {
- struct.success = iprot.readString();
- struct.setSuccessIsSet(true);
- }
- if (incoming.get(1)) {
- struct.tse = new ThriftSecurityException();
- struct.tse.read(iprot);
- struct.setTseIsSet(true);
- }
- }
- }
-
- }
-
public static class authenticate_args implements org.apache.thrift.TBase<authenticate_args, authenticate_args._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("authenticate_args");
Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstance.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstance.java?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstance.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstance.java Thu Apr 18 01:34:36 2013
@@ -22,7 +22,6 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.Properties;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
@@ -32,8 +31,6 @@ import org.apache.accumulo.core.client.i
import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
-import org.apache.accumulo.core.security.handler.Authenticator;
-import org.apache.accumulo.core.security.handler.ZKAuthenticator;
import org.apache.accumulo.core.util.ByteBufferUtil;
import org.apache.accumulo.core.util.CachedConfiguration;
import org.apache.accumulo.core.util.TextUtil;
@@ -154,11 +151,6 @@ public class MockInstance implements Ins
}
@Override
- public String getAuthenticatorClassName() throws AccumuloException {
- return ZKAuthenticator.class.getCanonicalName();
- }
-
- @Override
public Connector getConnector(String principal, AuthenticationToken token) throws AccumuloException, AccumuloSecurityException {
Connector conn = new MockConnector(principal, acu, this);
if (!acu.users.containsKey(principal))
@@ -167,14 +159,4 @@ public class MockInstance implements Ins
throw new AccumuloSecurityException(principal, SecurityErrorCode.BAD_CREDENTIALS);
return conn;
}
-
- @Override
- public Connector getConnector(String principal, Properties props) throws AccumuloException, AccumuloSecurityException {
- return getConnector(principal, getAuthenticator().login(principal, props));
- }
-
- @Override
- public Authenticator getAuthenticator() throws AccumuloException, AccumuloSecurityException {
- return new ZKAuthenticator();
- }
}
Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/security/tokens/AuthenticationToken.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/security/tokens/AuthenticationToken.java?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/security/tokens/AuthenticationToken.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/security/tokens/AuthenticationToken.java Thu Apr 18 01:34:36 2013
@@ -16,6 +16,9 @@
*/
package org.apache.accumulo.core.client.security.tokens;
+import java.util.Properties;
+import java.util.Set;
+
import javax.security.auth.Destroyable;
import org.apache.hadoop.io.Writable;
@@ -24,5 +27,51 @@ import org.apache.hadoop.io.Writable;
* @since 1.5.0
*/
public interface AuthenticationToken extends Writable, Destroyable, Cloneable {
+
+ public static class TokenProperty implements Comparable<TokenProperty> {
+ private String key, description;
+ private boolean masked;
+
+ public TokenProperty(String name, String description, boolean mask) {
+ this.key = name;
+ this.description = description;
+ this.masked = mask;
+ }
+
+ public String toString() {
+ return this.key + " - " + description;
+ }
+
+ public String getKey() {
+ return this.key;
+ }
+
+ public String getDescription() {
+ return this.description;
+ }
+
+ public boolean getMask() {
+ return this.masked;
+ }
+
+ public int hashCode() {
+ return key.hashCode();
+ }
+
+ public boolean equals(Object o) {
+ if (o instanceof TokenProperty)
+ return ((TokenProperty) o).key.equals(key);
+ return false;
+ }
+
+ @Override
+ public int compareTo(TokenProperty o) {
+ return key.compareTo(o.key);
+ }
+ }
+
+ public void init(Properties properties);
+
+ public Set<TokenProperty> getProperties();
public AuthenticationToken clone();
}
Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/security/tokens/NullToken.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/security/tokens/NullToken.java?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/security/tokens/NullToken.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/security/tokens/NullToken.java Thu Apr 18 01:34:36 2013
@@ -19,6 +19,9 @@ package org.apache.accumulo.core.client.
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
+import java.util.Collections;
+import java.util.Properties;
+import java.util.Set;
import javax.security.auth.DestroyFailedException;
@@ -54,4 +57,12 @@ public class NullToken implements Authen
public boolean equals(Object obj) {
return obj instanceof NullToken;
}
+
+ @Override
+ public void init(Properties properties) {}
+
+ @Override
+ public Set<TokenProperty> getProperties() {
+ return Collections.emptySet();
+ }
}
Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/security/tokens/PasswordToken.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/security/tokens/PasswordToken.java?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/security/tokens/PasswordToken.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/security/tokens/PasswordToken.java Thu Apr 18 01:34:36 2013
@@ -21,6 +21,9 @@ import java.io.DataOutput;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Arrays;
+import java.util.LinkedHashSet;
+import java.util.Properties;
+import java.util.Set;
import javax.security.auth.DestroyFailedException;
@@ -119,4 +122,19 @@ public class PasswordToken implements Au
throw new RuntimeException(e);
}
}
+
+ @Override
+ public void init(Properties properties) {
+ if (properties.containsKey("password"))
+ this.password = properties.getProperty("password").getBytes(Constants.UTF8);
+ else
+ throw new IllegalArgumentException("Missing 'password' property");
+ }
+
+ @Override
+ public Set<TokenProperty> getProperties() {
+ Set<TokenProperty> internal = new LinkedHashSet<TokenProperty>();
+ internal.add(new TokenProperty("password", "the password for the principal", true));
+ return internal;
+ }
}
Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/conf/Property.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/conf/Property.java?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/conf/Property.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/conf/Property.java Thu Apr 18 01:34:36 2013
@@ -22,6 +22,7 @@ import java.util.EnumSet;
import java.util.HashSet;
import java.util.Set;
+import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.accumulo.core.file.rfile.RFile;
import org.apache.accumulo.core.util.format.DefaultFormatter;
import org.apache.accumulo.core.util.interpret.DefaultScanInterpreter;
@@ -229,13 +230,11 @@ public enum Property {
TRACE_PREFIX("trace.", null, PropertyType.PREFIX, "Properties in this category affect the behavior of distributed tracing."),
TRACE_PORT("trace.port.client", "12234", PropertyType.PORT, "The listening port for the trace server"),
TRACE_TABLE("trace.table", "trace", PropertyType.STRING, "The name of the table to store distributed traces"),
- @Deprecated
- TRACE_USER("trace.user", "root", PropertyType.STRING, "DEPRECATED SINCE 1.5, USE trace.principal. The name of the user to store distributed traces"),
- TRACE_PRINCIPAL("trace.principal", "root", PropertyType.STRING, "The principal to store distributed traces"),
- @Deprecated
- TRACE_PASSWORD("trace.password", "secret", PropertyType.STRING,
- "DEPRECATED SINCE 1.5, USE trace.login. The password for the user used to store distributed traces"),
- TRACE_LOGIN_PROPERTIES("trace.login", null, PropertyType.PREFIX, "The login credentials prefix for the principal used to store distributed traces"),
+ TRACE_USER("trace.user", "root", PropertyType.STRING, "The name of the user to store distributed traces"),
+ TRACE_PASSWORD("trace.password", "secret", PropertyType.STRING, "The password for the user used to store distributed traces"),
+ TRACE_TOKEN_PROPERTY_PREFIX("trace.token.property", null, PropertyType.PREFIX,
+ "The prefix used to create a token for storing distributed traces. For each propetry required by trace.token.type, place this prefix in front of it."),
+ TRACE_TOKEN_TYPE("trace.token.type", PasswordToken.class.getName(), PropertyType.CLASSNAME, "An AuthenticationToken type supported by the authorizer"),
// per table properties
TABLE_PREFIX("table.", null, PropertyType.PREFIX, "Properties in this category affect tablet server treatment of tablets, but can be configured "
Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/Shell.java Thu Apr 18 01:34:36 2013
@@ -55,7 +55,6 @@ import org.apache.accumulo.core.data.Key
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.data.thrift.TConstraintViolationSummary;
import org.apache.accumulo.core.security.AuditLevel;
-import org.apache.accumulo.core.security.handler.Authenticator;
import org.apache.accumulo.core.tabletserver.thrift.ConstraintViolationException;
import org.apache.accumulo.core.trace.DistributedTrace;
import org.apache.accumulo.core.util.BadArgumentException;
@@ -247,11 +246,8 @@ public class Shell extends ShellOptions
String sysUser = System.getProperty("user.name");
if (sysUser == null)
sysUser = "root";
- @SuppressWarnings("deprecation")
String user = cl.getOptionValue(usernameOption.getOpt());
- String principal = cl.getOptionValue(principalOption.getOpt(), sysUser);
-
- @SuppressWarnings("deprecation")
+
String passw = cl.getOptionValue(passwOption.getOpt(), null);
tabCompletion = !cl.hasOption(tabCompleteOption.getLongOpt());
String[] loginOptions = cl.getOptionValues(loginOption.getOpt());
@@ -261,14 +257,16 @@ public class Shell extends ShellOptions
// process default parameters if unspecified
try {
- if (loginOptions != null) {
+ if (loginOptions != null && cl.hasOption(tokenOption.getOpt())) {
Properties props = new Properties();
for (String loginOption : loginOptions)
for (String lo : loginOption.split(",")) {
String[] split = lo.split("=");
props.put(split[0], split[1]);
}
- this.token = instance.getAuthenticator().login(principal, props);
+
+ this.token = Class.forName(cl.getOptionValue(tokenOption.getOpt())).asSubclass(AuthenticationToken.class).newInstance();
+ this.token.init(props);
}
if (!cl.hasOption(fakeOption.getLongOpt())) {
@@ -288,30 +286,6 @@ public class Shell extends ShellOptions
}
if (this.token == null) {
- List<Set<Authenticator.AuthProperty>> loginList = instance.getAuthenticator().getProperties();
- int loginMethod = 0;
- if (loginList.size() > 1) {
- System.out.println("Please select your preferred login method: ");
- int i = 0;
- for (Set<Authenticator.AuthProperty> set : loginList) {
- System.out.println(i + " " + set);
- i++;
- }
- loginMethod = Integer.parseInt(reader.readLine());
- }
- Set<Authenticator.AuthProperty> chosenMethod = loginList.get(loginMethod);
- Properties props = new Properties();
- for (Authenticator.AuthProperty prop : chosenMethod) {
- String value;
- if (prop.getMask())
- value = readMaskedLine("Enter " + prop + ": ", '*');
- else
- value = reader.readLine("Enter " + prop + ": ");
- props.setProperty(prop.getKey(), value);
- }
- this.token = instance.getAuthenticator().login(principal, props);
- }
- if (this.token == null) {
reader.printNewline();
configError = true;
return true;
@@ -319,8 +293,6 @@ public class Shell extends ShellOptions
this.setTableName("");
this.principal = user;
- if (this.principal == null)
- this.principal = principal;
connector = instance.getConnector(this.principal, token);
} catch (Exception e) {
Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/ShellOptions.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/ShellOptions.java?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/ShellOptions.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/util/shell/ShellOptions.java Thu Apr 18 01:34:36 2013
@@ -33,12 +33,12 @@ public abstract class ShellOptions {
public static final String helpLongOption = "help";
final Options opts = new Options();
- @Deprecated // since 1.5
+
final Option usernameOption = new Option("u", "user", true, "username (defaults to your OS user)");
- final Option principalOption = new Option("pr", "principal", true, "principal (defaults to your OS user)");
- @Deprecated // since 1.5
final Option passwOption = new Option("p", "password", true, "password (prompt for password if this option is missing)");
- final Option loginOption = new Option("l", "login property", true, "login properties in the format key=value. Reuse -l for each property and/or comma seperate (prompt for properties if this option is missing");
+ final Option tokenOption = new Option("tc", "tokenClass", true, "token type to create, use the -l to pass options");
+ final Option loginOption = new Option("l", "tokenProperty", true,
+ "login properties in the format key=value. Reuse -l for each property and/or comma seperate (prompt for properties if this option is missing");
final Option tabCompleteOption = new Option(null, "disable-tab-completion", false, "disables tab completion (for less overhead when scripting)");
final Option debugOption = new Option(null, "debug", false, "enables client debugging");
@@ -59,11 +59,11 @@ public abstract class ShellOptions {
public ShellOptions() {
usernameOption.setArgName("user");
opts.addOption(usernameOption);
- opts.addOption(principalOption);
passwOption.setArgName("pass");
opts.addOption(passwOption);
opts.addOption(loginOption);
+ opts.addOption(tokenOption);
opts.addOption(tabCompleteOption);
Modified: accumulo/trunk/core/src/main/thrift/client.thrift
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/thrift/client.thrift?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/thrift/client.thrift (original)
+++ accumulo/trunk/core/src/main/thrift/client.thrift Thu Apr 18 01:34:36 2013
@@ -110,7 +110,6 @@ service ClientService {
void changeLocalUserPassword(4:trace.TInfo tinfo, 5:security.TCredentials credentials, 2:string principal, 3:binary password) throws (1:ThriftSecurityException sec)
// authentication-related methods
- string getAuthenticatorClassName() throws (1:ThriftSecurityException tse);
bool authenticate(1:trace.TInfo tinfo, 2:security.TCredentials credentials) throws (1:ThriftSecurityException sec)
bool authenticateUser(1:trace.TInfo tinfo, 2:security.TCredentials credentials, 3:security.TCredentials toAuth) throws (1:ThriftSecurityException sec)
Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java (original)
+++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java Thu Apr 18 01:34:36 2013
@@ -25,7 +25,6 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-import java.util.Properties;
import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
@@ -49,7 +48,6 @@ import org.apache.accumulo.core.data.Mut
import org.apache.accumulo.core.data.PartialKey;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.Value;
-import org.apache.accumulo.core.security.handler.Authenticator;
import org.apache.accumulo.core.security.thrift.TCredentials;
import org.apache.accumulo.core.util.MetadataTable;
import org.apache.accumulo.core.util.Pair;
@@ -456,27 +454,11 @@ public class TabletLocatorImplTest exten
public Connector getConnector(org.apache.accumulo.core.security.thrift.AuthInfo auth) throws AccumuloException, AccumuloSecurityException {
return getConnector(auth.user, auth.getPassword());
}
-
- @Override
- public String getAuthenticatorClassName() throws AccumuloException {
- return null;
- // Doesn't matter
- }
-
+
@Override
public Connector getConnector(String principal, AuthenticationToken token) throws AccumuloException, AccumuloSecurityException {
throw new UnsupportedOperationException();
}
-
- @Override
- public Connector getConnector(String principal, Properties props) throws AccumuloException, AccumuloSecurityException {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Authenticator getAuthenticator() throws AccumuloException, AccumuloSecurityException {
- throw new UnsupportedOperationException();
- }
}
static class TServers {
Propchange: accumulo/trunk/examples/
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5/examples:r1469113
Propchange: accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java:r1469113
Propchange: accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java:r1469113
Propchange: accumulo/trunk/pom.xml
------------------------------------------------------------------------------
Merged /accumulo/branches/1.5/pom.xml:r1469113
Modified: accumulo/trunk/proxy/proxy.properties
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/proxy.properties?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/proxy/proxy.properties (original)
+++ accumulo/trunk/proxy/proxy.properties Thu Apr 18 01:34:36 2013
@@ -16,6 +16,7 @@
org.apache.accumulo.proxy.ProxyServer.useMockInstance=false
org.apache.accumulo.proxy.ProxyServer.useMiniAccumulo=false
org.apache.accumulo.proxy.ProxyServer.protocolFactory=org.apache.thrift.protocol.TCompactProtocol$Factory
+org.apache.accumulo.proxy.ProxyServer.tokenClass=org.apache.accumulo.core.client.security.tokens.PasswordToken
org.apache.accumulo.proxy.ProxyServer.port=42424
org.apache.accumulo.proxy.ProxyServer.instancename=test
Modified: accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java (original)
+++ accumulo/trunk/proxy/src/main/java/org/apache/accumulo/proxy/ProxyServer.java Thu Apr 18 01:34:36 2013
@@ -99,6 +99,7 @@ public class ProxyServer implements Accu
public static final Logger logger = Logger.getLogger(ProxyServer.class);
protected Instance instance;
+ protected Class<? extends AuthenticationToken> tokenClass;
static protected class ScannerPlusIterator {
public ScannerBase scanner;
@@ -151,6 +152,12 @@ public class ProxyServer implements Accu
instance = new ZooKeeperInstance(props.getProperty("org.apache.accumulo.proxy.ProxyServer.instancename"),
props.getProperty("org.apache.accumulo.proxy.ProxyServer.zookeepers"));
+ try {
+ tokenClass = Class.forName(props.getProperty("org.apache.accumulo.proxy.ProxyServer.tokenClass")).asSubclass(AuthenticationToken.class);
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException(e);
+ }
+
scannerCache = CacheBuilder.newBuilder().expireAfterAccess(10, TimeUnit.MINUTES).maximumSize(1000).removalListener(new CloseScanner()).build();
writerCache = CacheBuilder.newBuilder().expireAfterAccess(10, TimeUnit.MINUTES).maximumSize(1000).removalListener(new CloseWriter()).build();
@@ -1231,6 +1238,15 @@ public class ProxyServer implements Accu
private AuthenticationToken getToken(String principal, Map<String, String> properties) throws AccumuloSecurityException, AccumuloException {
Properties props = new Properties();
props.putAll(properties);
- return instance.getAuthenticator().login(principal, props);
+ AuthenticationToken token;
+ try {
+ token = tokenClass.newInstance();
+ } catch (InstantiationException e) {
+ throw new AccumuloException(e);
+ } catch (IllegalAccessException e) {
+ throw new AccumuloException(e);
+ }
+ token.init(props);
+ return token;
}
}
Modified: accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java (original)
+++ accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/SimpleTest.java Thu Apr 18 01:34:36 2013
@@ -16,7 +16,31 @@
*/
package org.apache.accumulo.proxy;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.InputStreamReader;
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Random;
+import java.util.Set;
+import java.util.TreeMap;
+
import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.accumulo.core.conf.DefaultConfiguration;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.Value;
@@ -27,8 +51,30 @@ import org.apache.accumulo.core.iterator
import org.apache.accumulo.core.iterators.user.SummingCombiner;
import org.apache.accumulo.core.util.UtilWaitThread;
import org.apache.accumulo.examples.simple.constraints.NumericValueConstraint;
+import org.apache.accumulo.proxy.thrift.AccumuloException;
import org.apache.accumulo.proxy.thrift.AccumuloProxy.Client;
-import org.apache.accumulo.proxy.thrift.*;
+import org.apache.accumulo.proxy.thrift.ActiveCompaction;
+import org.apache.accumulo.proxy.thrift.ActiveScan;
+import org.apache.accumulo.proxy.thrift.BatchScanOptions;
+import org.apache.accumulo.proxy.thrift.ColumnUpdate;
+import org.apache.accumulo.proxy.thrift.CompactionReason;
+import org.apache.accumulo.proxy.thrift.CompactionType;
+import org.apache.accumulo.proxy.thrift.IteratorScope;
+import org.apache.accumulo.proxy.thrift.IteratorSetting;
+import org.apache.accumulo.proxy.thrift.Key;
+import org.apache.accumulo.proxy.thrift.MutationsRejectedException;
+import org.apache.accumulo.proxy.thrift.PartialKey;
+import org.apache.accumulo.proxy.thrift.Range;
+import org.apache.accumulo.proxy.thrift.ScanColumn;
+import org.apache.accumulo.proxy.thrift.ScanOptions;
+import org.apache.accumulo.proxy.thrift.ScanResult;
+import org.apache.accumulo.proxy.thrift.ScanState;
+import org.apache.accumulo.proxy.thrift.ScanType;
+import org.apache.accumulo.proxy.thrift.SystemPermission;
+import org.apache.accumulo.proxy.thrift.TableNotFoundException;
+import org.apache.accumulo.proxy.thrift.TablePermission;
+import org.apache.accumulo.proxy.thrift.TimeType;
+import org.apache.accumulo.proxy.thrift.WriterOptions;
import org.apache.accumulo.test.MiniAccumuloCluster;
import org.apache.accumulo.test.functional.SlowIterator;
import org.apache.commons.io.FileUtils;
@@ -45,14 +91,6 @@ import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.InputStreamReader;
-import java.nio.ByteBuffer;
-import java.util.*;
-
-import static org.junit.Assert.*;
-
/**
* Call every method on the proxy and try to verify that it works.
*/
@@ -96,6 +134,7 @@ public class SimpleTest {
Properties props = new Properties();
props.put("org.apache.accumulo.proxy.ProxyServer.instancename", accumulo.getInstanceName());
props.put("org.apache.accumulo.proxy.ProxyServer.zookeepers", accumulo.getZooKeepers());
+ props.put("org.apache.accumulo.proxy.ProxyServer.tokenClass", PasswordToken.class.getName());
protocolClass = getRandomProtocol();
System.out.println(protocolClass.getName());
Modified: accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyInstanceOperations.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyInstanceOperations.java?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyInstanceOperations.java (original)
+++ accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyInstanceOperations.java Thu Apr 18 01:34:36 2013
@@ -24,6 +24,7 @@ import java.nio.ByteBuffer;
import java.util.Properties;
import java.util.TreeMap;
+import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.thrift.TException;
import org.apache.thrift.protocol.TCompactProtocol;
import org.apache.thrift.server.TServer;
@@ -43,6 +44,7 @@ public class TestProxyInstanceOperations
public static void setup() throws Exception {
Properties prop = new Properties();
prop.setProperty("org.apache.accumulo.proxy.ProxyServer.useMockInstance", "true");
+ prop.put("org.apache.accumulo.proxy.ProxyServer.tokenClass", PasswordToken.class.getName());
proxy = Proxy.createProxyServer(Class.forName("org.apache.accumulo.proxy.thrift.AccumuloProxy"), Class.forName("org.apache.accumulo.proxy.ProxyServer"),
port, TCompactProtocol.Factory.class, prop);
Modified: accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyReadWrite.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyReadWrite.java?rev=1469120&r1=1469119&r2=1469120&view=diff
==============================================================================
--- accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyReadWrite.java (original)
+++ accumulo/trunk/proxy/src/test/java/org/apache/accumulo/proxy/TestProxyReadWrite.java Thu Apr 18 01:34:36 2013
@@ -28,14 +28,15 @@ import java.util.Properties;
import java.util.Set;
import java.util.TreeMap;
+import org.apache.accumulo.core.client.security.tokens.PasswordToken;
import org.apache.accumulo.core.iterators.user.RegExFilter;
import org.apache.accumulo.proxy.thrift.BatchScanOptions;
import org.apache.accumulo.proxy.thrift.ColumnUpdate;
-import org.apache.accumulo.proxy.thrift.ScanColumn;
import org.apache.accumulo.proxy.thrift.IteratorSetting;
import org.apache.accumulo.proxy.thrift.Key;
import org.apache.accumulo.proxy.thrift.KeyValue;
import org.apache.accumulo.proxy.thrift.Range;
+import org.apache.accumulo.proxy.thrift.ScanColumn;
import org.apache.accumulo.proxy.thrift.ScanOptions;
import org.apache.accumulo.proxy.thrift.ScanResult;
import org.apache.accumulo.proxy.thrift.TimeType;
@@ -60,6 +61,7 @@ public class TestProxyReadWrite {
public static void setup() throws Exception {
Properties prop = new Properties();
prop.setProperty("org.apache.accumulo.proxy.ProxyServer.useMockInstance", "true");
+ prop.put("org.apache.accumulo.proxy.ProxyServer.tokenClass", PasswordToken.class.getName());
proxy = Proxy.createProxyServer(Class.forName("org.apache.accumulo.proxy.thrift.AccumuloProxy"), Class.forName("org.apache.accumulo.proxy.ProxyServer"),
port, TCompactProtocol.Factory.class, prop);