public void Authenticator_InitialResponse_With_DseAuthenticator_Should_Return_Mechanism() { var authProvider = new DsePlainTextAuthProvider("u", "p"); authProvider.SetName(DseAuthenticatorName); var authenticator = authProvider.NewAuthenticator(null); CollectionAssert.AreEqual(Encoding.UTF8.GetBytes("PLAIN"), authenticator.InitialResponse()); }
public void Authenticator_InitialResponse_With_Other_Authenticator_Should_Return_Credentials() { var authProvider = new DsePlainTextAuthProvider("u", "p"); authProvider.SetName("org.other.authenticator"); var authenticator = authProvider.NewAuthenticator(null); CollectionAssert.AreEqual( new byte[] { 0, Encoding.UTF8.GetBytes("u")[0], 0, Encoding.UTF8.GetBytes("p")[0] }, authenticator.InitialResponse()); }
public void Should_Authenticate_Against_Dse_Daemon_With_PasswordAuthenticator() { CcmHelper.Start( 1, cassYamlOptions: new[] { "authenticator: PasswordAuthenticator" }, jvmArgs: new[] { "-Dcassandra.superuser_setup_delay_ms=0" }); Trace.TraceInformation("Waiting additional time for test Cluster to be ready"); Thread.Sleep(15000); var authProvider = new DsePlainTextAuthProvider("cassandra", "cassandra"); using (var cluster = Cluster.Builder() .AddContactPoint(CcmHelper.InitialContactPoint) .WithAuthProvider(authProvider) .Build()) { var session = cluster.Connect(); AssertCanQuery(session); } }
public void Should_Authenticate_Against_Dse_5_DseAuthenticator() { CcmHelper.Start( 1, new[] { "authentication_options.default_scheme: internal" }, new[] { "authenticator: com.datastax.bdp.cassandra.auth.DseAuthenticator" }, new[] { "-Dcassandra.superuser_setup_delay_ms=0" }); Trace.TraceInformation("Waiting additional time for test Cluster to be ready"); Thread.Sleep(15000); var authProvider = new DsePlainTextAuthProvider("cassandra", "cassandra"); using (var cluster = Cluster.Builder() .AddContactPoint(CcmHelper.InitialContactPoint) .WithAuthProvider(authProvider) .Build()) { var session = cluster.Connect(); AssertCanQuery(session); } }