Search in sources :

Example 1 with PasswordAuthenticator

use of org.apache.cassandra.auth.PasswordAuthenticator in project cassandra by apache.

the class SetAuthCacheConfigTest method testSetConfig.

@Test
public void testSetConfig() {
    assertSetConfig(AuthenticatedUser.permissionsCache, PermissionsCacheMBean.CACHE_NAME);
    PasswordAuthenticator passwordAuthenticator = (PasswordAuthenticator) DatabaseDescriptor.getAuthenticator();
    assertSetConfig(passwordAuthenticator.getCredentialsCache(), PasswordAuthenticator.CredentialsCacheMBean.CACHE_NAME);
    assertSetConfig(AuthorizationProxy.jmxPermissionsCache, AuthorizationProxy.JmxPermissionsCacheMBean.CACHE_NAME);
    assertSetConfig(AuthenticatedUser.networkPermissionsCache, NetworkPermissionsCacheMBean.CACHE_NAME);
    assertSetConfig(Roles.cache, RolesCacheMBean.CACHE_NAME);
}
Also used : PasswordAuthenticator(org.apache.cassandra.auth.PasswordAuthenticator) Test(org.junit.Test)

Example 2 with PasswordAuthenticator

use of org.apache.cassandra.auth.PasswordAuthenticator in project cassandra by apache.

the class GetAuthCacheConfigTest method testGetConfig.

@Test
public void testGetConfig() {
    assertGetConfig(AuthenticatedUser.permissionsCache, PermissionsCacheMBean.CACHE_NAME);
    PasswordAuthenticator passwordAuthenticator = (PasswordAuthenticator) DatabaseDescriptor.getAuthenticator();
    assertGetConfig(passwordAuthenticator.getCredentialsCache(), PasswordAuthenticator.CredentialsCacheMBean.CACHE_NAME);
    assertGetConfig(AuthorizationProxy.jmxPermissionsCache, AuthorizationProxy.JmxPermissionsCacheMBean.CACHE_NAME);
    assertGetConfig(AuthenticatedUser.networkPermissionsCache, NetworkPermissionsCacheMBean.CACHE_NAME);
    assertGetConfig(Roles.cache, RolesCacheMBean.CACHE_NAME);
}
Also used : PasswordAuthenticator(org.apache.cassandra.auth.PasswordAuthenticator) Test(org.junit.Test)

Example 3 with PasswordAuthenticator

use of org.apache.cassandra.auth.PasswordAuthenticator in project cassandra by apache.

the class InvalidateCredentialsCacheTest method setup.

@BeforeClass
public static void setup() throws Exception {
    CQLTester.setUpClass();
    CQLTester.requireAuthentication();
    IRoleManager roleManager = DatabaseDescriptor.getRoleManager();
    roleManager.createRole(AuthenticatedUser.SYSTEM_USER, ROLE_A, AuthTestUtils.getLoginRoleOptions());
    roleManager.createRole(AuthenticatedUser.SYSTEM_USER, ROLE_B, AuthTestUtils.getLoginRoleOptions());
    PasswordAuthenticator passwordAuthenticator = (PasswordAuthenticator) DatabaseDescriptor.getAuthenticator();
    roleANegotiator = passwordAuthenticator.newSaslNegotiator(null);
    roleANegotiator.evaluateResponse(new PlainTextAuthProvider(ROLE_A.getRoleName(), "ignored").newAuthenticator((EndPoint) null, null).initialResponse());
    roleBNegotiator = passwordAuthenticator.newSaslNegotiator(null);
    roleBNegotiator.evaluateResponse(new PlainTextAuthProvider(ROLE_B.getRoleName(), "ignored").newAuthenticator((EndPoint) null, null).initialResponse());
    startJMXServer();
}
Also used : PasswordAuthenticator(org.apache.cassandra.auth.PasswordAuthenticator) IRoleManager(org.apache.cassandra.auth.IRoleManager) PlainTextAuthProvider(com.datastax.driver.core.PlainTextAuthProvider) BeforeClass(org.junit.BeforeClass)

Aggregations

PasswordAuthenticator (org.apache.cassandra.auth.PasswordAuthenticator)3 Test (org.junit.Test)2 PlainTextAuthProvider (com.datastax.driver.core.PlainTextAuthProvider)1 IRoleManager (org.apache.cassandra.auth.IRoleManager)1 BeforeClass (org.junit.BeforeClass)1