use of com.datastax.driver.core.Authenticator in project zipkin by openzipkin.
the class SessionFactoryTest method usernamePassword_impliesNullDelimitedUtf8Bytes.
@Test
public void usernamePassword_impliesNullDelimitedUtf8Bytes() {
Authenticator authenticator = buildCluster(Cassandra3Storage.builder().username("bob").password("secret").build()).getConfiguration().getProtocolOptions().getAuthProvider().newAuthenticator(new InetSocketAddress("localhost", 8080), null);
byte[] SASLhandshake = { 0, 'b', 'o', 'b', 0, 's', 'e', 'c', 'r', 'e', 't' };
assertThat(authenticator.initialResponse()).isEqualTo(SASLhandshake);
}
use of com.datastax.driver.core.Authenticator in project cassandra by apache.
the class PasswordAuthenticatorTest method testDecodeIllegalUserAndPwd.
private void testDecodeIllegalUserAndPwd(String username, String password) {
SaslNegotiator negotiator = authenticator.newSaslNegotiator(null);
Authenticator clientAuthenticator = (new PlainTextAuthProvider(username, password)).newAuthenticator((EndPoint) null, null);
negotiator.evaluateResponse(clientAuthenticator.initialResponse());
negotiator.getAuthenticatedUser();
}
use of com.datastax.driver.core.Authenticator in project zipkin by openzipkin.
the class SessionFactoryTest method usernamePassword_impliesNullDelimitedUtf8Bytes.
@Test
public void usernamePassword_impliesNullDelimitedUtf8Bytes() {
Authenticator authenticator = buildCluster(CassandraStorage.builder().username("bob").password("secret").build()).getConfiguration().getProtocolOptions().getAuthProvider().newAuthenticator(new InetSocketAddress("localhost", 8080), null);
byte[] SASLhandshake = { 0, 'b', 'o', 'b', 0, 's', 'e', 'c', 'r', 'e', 't' };
assertThat(authenticator.initialResponse()).isEqualTo(SASLhandshake);
}
Aggregations