Skip to content

[reactor-optional] Credentials as adapter 8x - #3842

Open
a-TODO-rov wants to merge 3 commits into
feature/reactor-optional-1from
creds-adapter-8x
Open

[reactor-optional] Credentials as adapter 8x#3842
a-TODO-rov wants to merge 3 commits into
feature/reactor-optional-1from
creds-adapter-8x

Conversation

@a-TODO-rov

@a-TODO-rov a-TODO-rov commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

alternative of #3838


Note

High Risk
Touches authentication, token renewal, connection handshake, sentinel/cluster address resolution, and removes reactive() accessors—any regression affects security-sensitive connect paths and backward-compatible APIs across a very large diff.

Overview
Reactor-free credentials and streaming re-auth. A new CredentialsProvider SPI resolves credentials via CompletionStage and publishes updates through subscribeToCredentials (with a Subscription handle). The driver’s auth path (RedisHandshake, ConnectionState, RedisAuthenticationHandler) uses this SPI; RedisCredentialsProvider is deprecated but kept via AsyncCredentialsProviderAdapter and default bridges from credentials() / resolveCredentials(). TokenBasedRedisCredentialsProvider (Entra ID) is rewritten on futures, listener lists, and an optional Executor instead of Reactor sinks/fluxes. RedisURI stores CredentialsProvider internally and exposes getCredentialsProviderAsync() for the non-reactive path.

Connect and routing without Reactor on the hot path. Socket address resolution and initial connect (AbstractRedisClient, ConnectionBuilder, RedisClient sentinel lookup, cluster node suppliers) switch from Mono<SocketAddress> to Supplier<CompletionStage<SocketAddress>>, including sentinel master discovery implemented with scheduled timeouts and async commands. Master/replica topology refresh and read routing drop Mono/Flux in favor of CompletableFuture chains, Pair instead of Reactor tuples, and helpers like Futures.withTimeout / unwrapExceptions; ResumeAfter is removed.

API cleanup for reactive command access. Eager reactive() fields and methods are removed from standalone, cluster, multi-DB, and pub/sub connections; cluster reactive code and dynamic command factories obtain APIs via connection.commands(RedisReactiveCommands.factory()) (and cluster equivalents). StatefulRedisConnection.commands(CommandsFactory) is now required on implementations. Reactive tracing uses getTraceContextAsync with a ContextViewMap adapter.

Docs: User guide streaming-credentials example matches the new provider contract (CompletionStage, subscribeToCredentials, typo fix for redisClient).

Reviewed by Cursor Bugbot for commit 404f10f. Bugbot is set up for automated code reviews on this repo. Configure here.

@a-TODO-rov
a-TODO-rov changed the base branch from main to feature/reactor-optional-1 July 13, 2026 15:56
@a-TODO-rov a-TODO-rov changed the title Creds adapter 8x [reactor-optional] Credentials as adapter 8x Jul 13, 2026
@a-TODO-rov
a-TODO-rov requested a review from atakavci July 13, 2026 16:04
* resolution.
*/
@FunctionalInterface
interface ImmediateCredentialsProvider extends CredentialsProvider {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might need to move it back into RedisCredentialsProvider and extend from it for binary compatibility.

@atakavci atakavci left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i didnt go till the end with this PR yet. so please correct me if i got the wrong sense around the approach.
what i have in mind is, instead of using an adapter, to keep up with RedisCredentialsProvider with every public API we have, but use/redirect it to leverage the CredentialsProvider anywhere we are using it. The default implementations and internal usage of it will be replacing the behaviour and get rid of utilizing mono/reactor while if someone has already provided their rector-version implementation they have, it will not be ignored and kick-in as it was. this will be backwards compatible, not binary may be(not sure) but at least compile time.

* @since 6.6
*/
public class TokenBasedRedisCredentialsProvider implements RedisCredentialsProvider, AutoCloseable {
public class TokenBasedRedisCredentialsProvider implements CredentialsProvider, AutoCloseable {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this simply means breaking binary compatibility. if there are other spots we already broke it, then lets never mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants