use of org.apache.cassandra.config.ParameterizedClass in project cassandra by apache.
the class CQLUserAuditTest method setup.
@BeforeClass
public static void setup() throws Exception {
OverrideConfigurationLoader.override((config) -> {
config.authenticator = "PasswordAuthenticator";
config.role_manager = "CassandraRoleManager";
config.diagnostic_events_enabled = true;
config.audit_logging_options.enabled = true;
config.audit_logging_options.logger = new ParameterizedClass("DiagnosticEventAuditLogger", null);
});
CQLTester.prepareServer();
System.setProperty("cassandra.superuser_setup_delay_ms", "0");
embedded = new EmbeddedCassandraService();
embedded.start();
executeAs(Arrays.asList("CREATE ROLE testuser WITH LOGIN = true AND SUPERUSER = false AND PASSWORD = 'foo'", "CREATE ROLE testuser_nologin WITH LOGIN = false AND SUPERUSER = false AND PASSWORD = 'foo'", "CREATE KEYSPACE testks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}", "CREATE TABLE testks.table1 (a text, b int, c int, PRIMARY KEY (a, b))", "CREATE TABLE testks.table2 (a text, b int, c int, PRIMARY KEY (a, b))"), "cassandra", "cassandra", null);
DiagnosticEventService.instance().subscribe(AuditEvent.class, auditEvents::add);
AuditLogManager.instance.initialize();
}
use of org.apache.cassandra.config.ParameterizedClass in project cassandra by apache.
the class SSLFactoryTest method testCacheKeyInequalityForCustomSslContextFactory.
@Test
public void testCacheKeyInequalityForCustomSslContextFactory() {
Map<String, String> parameters1 = new HashMap<>();
parameters1.put("key1", "value11");
parameters1.put("key2", "value12");
EncryptionOptions encryptionOptions1 = new EncryptionOptions().withSslContextFactory(new ParameterizedClass(DummySslContextFactoryImpl.class.getName(), parameters1)).withProtocol("TLSv1.1");
SSLFactory.CacheKey cacheKey1 = new SSLFactory.CacheKey(encryptionOptions1, ISslContextFactory.SocketType.SERVER);
Map<String, String> parameters2 = new HashMap<>();
parameters2.put("key1", "value21");
parameters2.put("key2", "value22");
EncryptionOptions encryptionOptions2 = new EncryptionOptions().withSslContextFactory(new ParameterizedClass(DummySslContextFactoryImpl.class.getName(), parameters2)).withProtocol("TLSv1.1");
SSLFactory.CacheKey cacheKey2 = new SSLFactory.CacheKey(encryptionOptions2, ISslContextFactory.SocketType.SERVER);
Assert.assertNotEquals(cacheKey1, cacheKey2);
}
Aggregations