Auth (apache-cassandra API)
Date: 2014-10-21

org.apache.cassandra.auth

## Class Auth

- java.lang.Object
- - org.apache.cassandra.auth.Auth

- All Implemented Interfaces:
    AuthMBean

      public class Auth
      extends java.lang.Object
      implements AuthMBean

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Auth.MigrationListener` IMigrationListener implementation that cleans up permissions on dropped resources.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `AUTH_KS`
    `static java.lang.String` | `DEFAULT_SUPERUSER_NAME`
    `static com.google.common.cache.LoadingCache<Pair<AuthenticatedUser,IResource>,java.util.Set<Permission>>` | `permissionsCache`
    `static long` | `SUPERUSER_SETUP_DELAY`
    `static java.lang.String` | `USERS_CF`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Auth()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `deleteUser(java.lang.String username)` Deletes the user from AUTH_KS.USERS_CF.
    `int` | `getPermissionsValidity()`
    `static void` | `insertUser(java.lang.String username, boolean isSuper)` Inserts the user into AUTH_KS.USERS_CF (or overwrites their superuser status as a result of an ALTER USER query).
    `void` | `invalidatePermissionsCache()`
    `static boolean` | `isExistingUser(java.lang.String username)` Checks if the username is stored in AUTH_KS.USERS_CF.
    `static boolean` | `isSuperuser(java.lang.String username)` Checks if the user is a known superuser.
    `void` | `setPermissionsValidity(int timeoutInMs)`
    `static void` | `setup()` Sets up Authenticator and Authorizer.
    `static void` | `setupTable(java.lang.String name, java.lang.String cql)` Set up table from given CREATE TABLE statement under system_auth keyspace, if not already done so.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_SUPERUSER_NAME

          public static final java.lang.String DEFAULT_SUPERUSER_NAME

      See Also:
        Constant Field Values

    - #### SUPERUSER_SETUP_DELAY

          public static final long SUPERUSER_SETUP_DELAY

    - #### AUTH_KS

          public static final java.lang.String AUTH_KS

      See Also:
        Constant Field Values

    - #### USERS_CF

          public static final java.lang.String USERS_CF

      See Also:
        Constant Field Values

    - #### permissionsCache

          public static volatile com.google.common.cache.LoadingCache<Pair<AuthenticatedUser,IResource>,java.util.Set<Permission>> permissionsCache

  - ### Constructor Detail

    - #### Auth

          public Auth()

  - ### Method Detail

    - #### getPermissionsValidity

          public int getPermissionsValidity()

      Specified by:
        `getPermissionsValidity` in interface `AuthMBean`

    - #### setPermissionsValidity

          public void setPermissionsValidity(int timeoutInMs)

      Specified by:
        `setPermissionsValidity` in interface `AuthMBean`

    - #### invalidatePermissionsCache

          public void invalidatePermissionsCache()

      Specified by:
        `invalidatePermissionsCache` in interface `AuthMBean`

    - #### isExistingUser

          public static boolean isExistingUser(java.lang.String username)

      Checks if the username is stored in AUTH_KS.USERS_CF.
      Parameters:
        `username` - Username to query.
      Returns:
        whether or not Cassandra knows about the user.

    - #### isSuperuser

          public static boolean isSuperuser(java.lang.String username)

      Checks if the user is a known superuser.
      Parameters:
        `username` - Username to query.
      Returns:
        true is the user is a superuser, false if they aren't or don't exist at all.

    - #### insertUser

          public static void insertUser(java.lang.String username,
                        boolean isSuper)
                                 throws RequestExecutionException

      Inserts the user into AUTH_KS.USERS_CF (or overwrites their superuser status as a result of an ALTER USER query).
      Parameters:
        `username` - Username to insert.
        `isSuper` - User's new status.
      Throws:
        `RequestExecutionException`

    - #### deleteUser

          public static void deleteUser(java.lang.String username)
                                 throws RequestExecutionException

      Deletes the user from AUTH_KS.USERS_CF.
      Parameters:
        `username` - Username to delete.
      Throws:
        `RequestExecutionException`

    - #### setup

          public static void setup()

      Sets up Authenticator and Authorizer.

    - #### setupTable

          public static void setupTable(java.lang.String name,
                        java.lang.String cql)

      Set up table from given CREATE TABLE statement under system_auth keyspace, if not already done so.
      Parameters:
        `name` - name of the table
        `cql` - CREATE TABLE statement

Copyright © 2014 The Apache Software Foundation