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);
}
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);
}
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();
}
Aggregations