All Downloads are FREE. Search and download functionalities are using the official Maven repository.

redis.clients.jedis.commands.AccessControlLogBinaryCommands Maven / Gradle / Ivy

The newest version!
package redis.clients.jedis.commands;

import java.util.List;
import redis.clients.jedis.CommandArguments;
import redis.clients.jedis.resps.AccessControlUser;

/**
 * This class provides the interfaces necessary to interact with
 * Access Control Lists (ACLs) within redis. These are the interfaces
 * for binary (i.e. non-decoded) interactions.
 *
 * @see Redis ACL Guide
 */
public interface AccessControlLogBinaryCommands {

  /**
   * Returns the username used to authenticate the current connection.
   *
   * @see ACL WHOAMI
   * @return The username used for the current connection
   */
  byte[] aclWhoAmIBinary();

  /**
   * Generate a random password
   *
   * @see ACL GENPASS
   * @return A random password
   */
  byte[] aclGenPassBinary();

  /**
   * Generate a random password
   *
   * @param bits the number of output bits
   * @return A random password
   */
  byte[] aclGenPassBinary(int bits);

  /**
   * Returns the currently active ACL rules on the Redis Server
   *
   * @see ACL LIST
   * @return An array of ACL rules
   */
  List aclListBinary();

  /**
   * Shows a list of all usernames currently configured with access control
   * lists (ACL).
   *
   * @see ACL USERS
   * @return list of users
   */
  List aclUsersBinary();

  /**
   * The command returns all the rules defined for an existing ACL user.
   * @param name username
   * @return a list of ACL rule definitions for the user.
   */
  AccessControlUser aclGetUser(byte[] name);

  /**
   * Create an ACL for the specified user with the default rules.
   *
   * @param name user who receives an acl
   * @see ACL SETUSER
   * @return A string containing OK on success
   */
  String aclSetUser(byte[] name);

  /**
   * Create an ACL for the specified user, while specifying the rules.
   *
   * @param name user who receives an acl
   * @param rules the acl rules for the specified user
   * @see ACL SETUSER
   * @return A string containing OK on success
   */
  String aclSetUser(byte[] name, byte[]... rules);

  /**
   * Delete the specified user, from the ACL.
   *
   * @param names The username to delete
   * @see ACL DELUSER
   * @return The number of users delete
   */
  long aclDelUser(byte[]... names);

  /**
   * Show the available ACL categories.
   *
   * @see ACL CAT
   * @return the available ACL categories
   */
  List aclCatBinary();

  /**
   * Show the available ACLs for a given category.
   *
   * @param category The category for which to list available ACLs
   * @see ACL CAT
   * @return the available ACL categories
   */
  List aclCat(byte[] category);

  /**
   * Shows the recent ACL security events.
   *
   * @see ACL LOG
   * @return The list of recent security events
   */
  List aclLogBinary();

  /**
   * Shows the recent limit ACL security events.
   *
   * @param limit The number of results to return
   * @see ACL LOG
   * @return The list of recent security events
   */
  List aclLogBinary(int limit);

  /**
   * Reset the script event log
   *
   * @see ACL LOG
   * @return The OK string
   */
  String aclLogReset();

  /**
   * This function tells Redis to reload its external ACL rules,
   * when Redis is configured with an external ACL file
   *
   * @see ACL LOAD
   * @return OK or error text
   */
  String aclLoad();

  /**
   * Save the currently defined in-memory ACL to disk.
   *
   * @see ACL SAVE
   * @return OK on success
   */
  String aclSave();

  byte[] aclDryRunBinary(byte[] username, byte[] command, byte[]... args);

  byte[] aclDryRunBinary(byte[] username, CommandArguments commandArgs);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy