Interface RedisCredentials


  • public interface RedisCredentials
    Provides credentials to access a secured Redis service.
    Since:
    6.2
    Author:
    Jon Iantosca, Mark Paluch
    • Method Detail

      • getUsername

        String getUsername()
        Retrieve the Redis user, used to identify the user interacting with Redis. Can be used with Redis 6 and newer server versions.
        Returns:
        the user name. Can be null if not set.
        See Also:
        hasUsername()
      • hasUsername

        boolean hasUsername()
        Return whether the username is configured.
        Returns:
        true if the username is configured; false otherwise.
      • getPassword

        char[] getPassword()
        Retrieve the Redis password, used to authenticate the user interacting with Redis.
        Returns:
        the password. Can be null if not set.
        See Also:
        hasUsername()
      • hasPassword

        boolean hasPassword()
        Return whether the password is configured.
        Returns:
        true if the password is configured; false otherwise
      • just

        static RedisCredentials just​(String username,
                                     char[] password)
        Create a static RedisCredentials object from username and password.
        Parameters:
        username - can be null
        password - can be null
        Returns:
        the static RedisCredentials object from username and password