From 21bf696c07231bf204e774dd7780d1e7997c8b06 Mon Sep 17 00:00:00 2001 From: ggivo Date: Sun, 8 Dec 2024 14:13:55 +0200 Subject: [PATCH] formating --- .../java/io/lettuce/core/ClientOptions.java | 31 ++++++++++++------- ...gCredentialsProviderlIntegrationTests.java | 3 +- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/main/java/io/lettuce/core/ClientOptions.java b/src/main/java/io/lettuce/core/ClientOptions.java index f8327a4c9..0c34eec77 100644 --- a/src/main/java/io/lettuce/core/ClientOptions.java +++ b/src/main/java/io/lettuce/core/ClientOptions.java @@ -706,18 +706,22 @@ public TimeoutOptions getTimeoutOptions() { /** * Defines the re-authentication behavior of the Redis client in relation to the {@link CredentialsProvider}. - */s + */ public enum ReauthenticateBehavior { /** * This is the default behavior. The client will fetch current credentials from the underlying * {@link RedisCredentialsProvider} only when required. * - *

No re-authentication is performed automatically when new credentials are emitted by the - * {@link StreamingCredentialsProvider} .

+ *

+ * No re-authentication is performed automatically when new credentials are emitted by the + * {@link StreamingCredentialsProvider} . + *

* - *

This behavior is suitable for use cases with static credentials or where explicit reconnection - * is required to change credentials.

+ *

+ * This behavior is suitable for use cases with static credentials or where explicit reconnection is required to change + * credentials. + *

*/ DEFAULT, @@ -725,14 +729,17 @@ public enum ReauthenticateBehavior { * Automatically triggers re-authentication whenever new credentials are emitted by the * {@link StreamingCredentialsProvider} or any other credentials manager. * - *

When enabled, the client subscribes to the credentials stream provided by the - * {@link StreamingCredentialsProvider} (or other compatible sources) and issues an {@code 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.

+ *

+ * When enabled, the client subscribes to the credentials stream provided by the {@link StreamingCredentialsProvider} + * (or other compatible sources) and issues an {@code 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: {@code 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.

+ *

+ * Note: {@code 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. + *

*/ ON_NEW_CREDENTIALS } diff --git a/src/test/java/io/lettuce/core/cluster/RedisClusterStreamingCredentialsProviderlIntegrationTests.java b/src/test/java/io/lettuce/core/cluster/RedisClusterStreamingCredentialsProviderlIntegrationTests.java index aeb7dd49b..3c8f20a96 100644 --- a/src/test/java/io/lettuce/core/cluster/RedisClusterStreamingCredentialsProviderlIntegrationTests.java +++ b/src/test/java/io/lettuce/core/cluster/RedisClusterStreamingCredentialsProviderlIntegrationTests.java @@ -140,8 +140,7 @@ void nodeSelectionApiShouldWork() { @Test void shouldPerformNodeConnectionReauth() { ClusterClientOptions origClientOptions = redisClient.getClusterClientOptions(); - origClientOptions.mutate() - .reauthenticateBehavior(ClientOptions.ReauthenticateBehavior.ON_NEW_CREDENTIALS).build(); + origClientOptions.mutate().reauthenticateBehavior(ClientOptions.ReauthenticateBehavior.ON_NEW_CREDENTIALS).build(); redisClient.setOptions(origClientOptions.mutate() .reauthenticateBehavior(ClientOptions.ReauthenticateBehavior.ON_NEW_CREDENTIALS).build());