[reactor-optional] Credentials as adapter 8x - #3842
Conversation
| * resolution. | ||
| */ | ||
| @FunctionalInterface | ||
| interface ImmediateCredentialsProvider extends CredentialsProvider { |
There was a problem hiding this comment.
might need to move it back into RedisCredentialsProvider and extend from it for binary compatibility.
atakavci
left a comment
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
this simply means breaking binary compatibility. if there are other spots we already broke it, then lets never mind.
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
CredentialsProviderSPI resolves credentials viaCompletionStageand publishes updates throughsubscribeToCredentials(with aSubscriptionhandle). The driver’s auth path (RedisHandshake,ConnectionState,RedisAuthenticationHandler) uses this SPI;RedisCredentialsProvideris deprecated but kept viaAsyncCredentialsProviderAdapterand default bridges fromcredentials()/resolveCredentials().TokenBasedRedisCredentialsProvider(Entra ID) is rewritten on futures, listener lists, and an optionalExecutorinstead of Reactor sinks/fluxes.RedisURIstoresCredentialsProviderinternally and exposesgetCredentialsProviderAsync()for the non-reactive path.Connect and routing without Reactor on the hot path. Socket address resolution and initial connect (
AbstractRedisClient,ConnectionBuilder,RedisClientsentinel lookup, cluster node suppliers) switch fromMono<SocketAddress>toSupplier<CompletionStage<SocketAddress>>, including sentinel master discovery implemented with scheduled timeouts and async commands. Master/replica topology refresh and read routing dropMono/Fluxin favor ofCompletableFuturechains,Pairinstead of Reactor tuples, and helpers likeFutures.withTimeout/unwrapExceptions;ResumeAfteris 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 viaconnection.commands(RedisReactiveCommands.factory())(and cluster equivalents).StatefulRedisConnection.commands(CommandsFactory)is now required on implementations. Reactive tracing usesgetTraceContextAsyncwith aContextView→Mapadapter.Docs: User guide streaming-credentials example matches the new provider contract (
CompletionStage,subscribeToCredentials, typo fix forredisClient).Reviewed by Cursor Bugbot for commit 404f10f. Bugbot is set up for automated code reviews on this repo. Configure here.