Codota Logo
org.apache.cassandra.auth
Code IndexAdd Codota to your IDE (free)

How to use org.apache.cassandra.auth

Best Java code snippets using org.apache.cassandra.auth (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: jsevellec/cassandra-unit

/**
 * Checks the user's superuser status.
 * Only a superuser is allowed to perform CREATE USER and DROP USER queries.
 * Im most cased, though not necessarily, a superuser will have Permission.ALL on every resource
 * (depends on IAuthorizer implementation).
 */
public boolean isSuper()
{
  return !isAnonymous() && Roles.hasSuperuserStatus(role);
}
origin: com.facebook.presto.cassandra/cassandra-server

/**
 * Checks the user's superuser status.
 * Only a superuser is allowed to perform CREATE USER and DROP USER queries.
 * Im most cased, though not necessarily, a superuser will have Permission.ALL on every resource
 * (depends on IAuthorizer implementation).
 */
public boolean isSuper()
{
  return !isAnonymous() && Auth.isSuperuser(name);
}
origin: org.apache.cassandra/cassandra-all

public boolean isExistingRole(RoleResource role)
{
  return getRole(role.getRoleName()) != NULL_ROLE;
}
origin: org.apache.cassandra/cassandra-all

private void addLookupEntry(IResource resource, RoleResource role) throws RequestExecutionException
{
  process(String.format("INSERT INTO %s.%s (resource, role) VALUES ('%s','%s')",
             SchemaConstants.AUTH_KEYSPACE_NAME,
             AuthKeyspace.RESOURCE_ROLE_INDEX,
             escape(resource.getName()),
             escape(role.getRoleName())));
}
origin: org.apache.cassandra/cassandra-all

private void collectRoles(Role role, Set<RoleResource> collected, boolean includeInherited) throws RequestValidationException, RequestExecutionException
{
  for (String memberOf : role.memberOf)
  {
    Role granted = getRole(memberOf);
    if (granted.equals(NULL_ROLE))
      continue;
    collected.add(RoleResource.role(granted.name));
    if (includeInherited)
      collectRoles(granted, collected, true);
  }
}
origin: jsevellec/cassandra-unit

public void onDropKeyspace(String ksName)
{
  DatabaseDescriptor.getAuthorizer().revokeAllOn(DataResource.keyspace(ksName));
  DatabaseDescriptor.getAuthorizer().revokeAllOn(FunctionResource.keyspace(ksName));
}
origin: Impetus/Kundera

    mode = PasswordMode.valueOf(pmode_plain);
    for (PasswordMode pm : PasswordMode.values())
      mode_values += "'" + pm + "', ";
    throw new AuthenticationException(authenticationErrorMessage(mode, username));
  switch (mode)
  throw new AuthenticationException(authenticationErrorMessage(mode, username));
return new AuthenticatedUser(username);
origin: Impetus/Kundera

String kspAdmins = accessProperties.getProperty(KEYSPACES_WRITE_PROPERTY);
for (String admin : kspAdmins.split(","))
  if (admin.equals(user.getName()))
    return (EnumSet<Permission>) Permission.ALL;
  if (reader.equals(user.getName())) {
    canRead = true;
    break;
  if (writer.equals(user.getName())) {
    canWrite = true;
    break;
origin: Impetus/Kundera

PasswordAuthenticator idAuth = new PasswordAuthenticator();
Map<String, String> credentials = new HashMap<String, String>();
credentials.put(idAuth.USERNAME_KEY, userName);
origin: org.apache.cassandra/cassandra-all

private void removeLookupEntry(IResource resource, RoleResource role) throws RequestExecutionException
{
  process(String.format("DELETE FROM %s.%s WHERE resource = '%s' and role = '%s'",
             SchemaConstants.AUTH_KEYSPACE_NAME,
             AuthKeyspace.RESOURCE_ROLE_INDEX,
             escape(resource.getName()),
             escape(role.getRoleName())));
}
origin: org.apache.cassandra/cassandra-all

public boolean canLogin(RoleResource role)
{
  return getRole(role.getRoleName()).canLogin;
}
origin: org.apache.cassandra/cassandra-all

public void onDropKeyspace(String ksName)
{
  DatabaseDescriptor.getAuthorizer().revokeAllOn(DataResource.keyspace(ksName));
  DatabaseDescriptor.getAuthorizer().revokeAllOn(FunctionResource.keyspace(ksName));
}
origin: org.apache.cassandra/cassandra-all

/**
 * Checks the user's superuser status.
 * Only a superuser is allowed to perform CREATE USER and DROP USER queries.
 * Im most cased, though not necessarily, a superuser will have Permission.ALL on every resource
 * (depends on IAuthorizer implementation).
 */
public boolean isSuper()
{
  return !isAnonymous() && Roles.hasSuperuserStatus(role);
}
origin: jsevellec/cassandra-unit

private void removeLookupEntry(IResource resource, RoleResource role) throws RequestExecutionException
{
  process(String.format("DELETE FROM %s.%s WHERE resource = '%s' and role = '%s'",
             SchemaConstants.AUTH_KEYSPACE_NAME,
             AuthKeyspace.RESOURCE_ROLE_INDEX,
             escape(resource.getName()),
             escape(role.getRoleName())));
}
origin: jsevellec/cassandra-unit

public boolean canLogin(RoleResource role)
{
  return getRole(role.getRoleName()).canLogin;
}
origin: com.strapdata.cassandra/cassandra-all

/**
 * Checks the user's superuser status.
 * Only a superuser is allowed to perform CREATE USER and DROP USER queries.
 * Im most cased, though not necessarily, a superuser will have Permission.ALL on every resource
 * (depends on IAuthorizer implementation).
 */
public boolean isSuper()
{
  return !isAnonymous() && Roles.hasSuperuserStatus(role);
}
origin: jsevellec/cassandra-unit

public boolean isSuper(RoleResource role)
{
  return getRole(role.getRoleName()).isSuper;
}
origin: org.apache.cassandra/cassandra-all

public boolean isSuper(RoleResource role)
{
  return getRole(role.getRoleName()).isSuper;
}
origin: jsevellec/cassandra-unit

public boolean isExistingRole(RoleResource role)
{
  return getRole(role.getRoleName()) != NULL_ROLE;
}
origin: com.strapdata.cassandra/cassandra-all

public boolean isExistingRole(RoleResource role)
{
  return getRole(role.getRoleName()) != NULL_ROLE;
}
org.apache.cassandra.auth

Most used classes

  • AuthenticatedUser
    Returned from IAuthenticator#authenticate(), represents an authenticated user everywhere internally.
  • PasswordAuthenticator
    PasswordAuthenticator is an IAuthenticator implementation that keeps credentials (rolenames and bcry
  • AllowAllInternodeAuthenticator
  • CassandraAuthorizer
    CassandraAuthorizer is an IAuthorizer implementation that keeps user permissions internally in C* us
  • DataResource
    The primary type of resource in Cassandra. Used to represent a table or a keyspace or the root level
  • IAuthorizer,
  • IInternodeAuthenticator,
  • IResource,
  • PasswordAuthenticator$PlainTextSaslAuthenticator,
  • Permission,
  • PermissionDetails,
  • PermissionsCache,
  • Resources,
  • AllowAllAuthenticator,
  • AllowAllAuthorizer,
  • AuthCache,
  • AuthConfig,
  • AuthKeyspace,
  • AuthMigrationListener
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now