public static enum ClientOptions.ReauthenticateBehavior extends Enum<ClientOptions.ReauthenticateBehavior>
RedisCredentialsProvider
could emit new credentials at runtime. This setting
controls how the driver reacts to these newly emitted credentials.Enum Constant and Description |
---|
DEFAULT
This is the default behavior.
|
ON_NEW_CREDENTIALS
Automatically triggers re-authentication whenever new credentials are emitted by a
RedisCredentialsProvider
that supports streaming, as indicated by RedisCredentialsProvider.supportsStreaming() . |
Modifier and Type | Method and Description |
---|---|
static ClientOptions.ReauthenticateBehavior |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ClientOptions.ReauthenticateBehavior[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ClientOptions.ReauthenticateBehavior DEFAULT
RedisCredentialsProvider
only when the driver needs to, e.g. when the connection is first established or when
it is re-established after a disconnect.
No re-authentication is performed when new credentials are emitted by a RedisCredentialsProvider
that
supports streaming. The client does not subscribe to or react to any updates in the credential stream provided by
RedisCredentialsProvider.credentials()
.
public static final ClientOptions.ReauthenticateBehavior ON_NEW_CREDENTIALS
RedisCredentialsProvider
that supports streaming, as indicated by RedisCredentialsProvider.supportsStreaming()
.
When this behavior is enabled, the client subscribes to the credential stream provided by
RedisCredentialsProvider.credentials()
and issues an AUTH
command to the Redis server each time new
credentials are received. This behavior supports dynamic credential scenarios, such as token-based authentication, or
credential rotation where credentials are refreshed periodically to maintain access.
Note: AUTH
commands issued as part of this behavior may interleave with user-submitted commands, as the
client performs re-authentication independently of user command flow.
public static ClientOptions.ReauthenticateBehavior[] values()
for (ClientOptions.ReauthenticateBehavior c : ClientOptions.ReauthenticateBehavior.values()) System.out.println(c);
public static ClientOptions.ReauthenticateBehavior valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2025 lettuce.io. All rights reserved.