-
Notifications
You must be signed in to change notification settings - Fork 985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Token based authentication integration with core extension #3063
Draft
ggivo
wants to merge
26
commits into
redis:main
Choose a base branch
from
ggivo:token-based-auth
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ggivo
changed the title
Token based auth
Token based authentication integration with core extension
Nov 28, 2024
ggivo
force-pushed
the
token-based-auth
branch
2 times, most recently
from
November 28, 2024 09:17
cb51afa
to
ec791b2
Compare
atakavci
reviewed
Dec 1, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i can anticipate what BaseRedisAuthenticationHandler
holds but lets see the actual impl before moving further.
This enables use cases like credential rotation and token based auth without client disconnect. Especially with Pub/Sub clients will reduce the chnance of missing events.
ggivo
force-pushed
the
token-based-auth
branch
from
December 3, 2024 10:30
dd30876
to
78a0aea
Compare
ggivo
force-pushed
the
token-based-auth
branch
from
December 4, 2024 10:37
78a0aea
to
6531424
Compare
DEFAULT_REAUTHENTICATE_BEHAVIOUR
- Moved Authentication handler to DefaultEndpoint - updated since 6.6.0
ggivo
force-pushed
the
token-based-auth
branch
from
December 8, 2024 12:51
1fa739e
to
78fb436
Compare
ggivo
force-pushed
the
token-based-auth
branch
from
December 8, 2024 13:10
78fb436
to
98e72fb
Compare
ggivo
force-pushed
the
token-based-auth
branch
from
December 8, 2024 13:13
d33710e
to
b7efe6c
Compare
Defer the re-auth operation in case there is on-going multi Tx in lettuce need to be externally synchronised when used in multithreaded env. Since re-auth happens from different thread we need to make sure it does not happen while there is ongoing transaction.
…provider with static one provider Add unit tests for setCredentials
ggivo
force-pushed
the
token-based-auth
branch
from
December 13, 2024 14:53
b7efe6c
to
7b0fb4c
Compare
move credentials() method to RedisCredentialsProvider. Resolve issue with unsafe cast after extending RedisCredentialsProvider with supportsStreaming() method
Provide a way for lettuce clients to use token-based authentication. TOKENs come with a TTL. After a Redis client authenticates with a TOKEN, if they didn't renew their authentication we need to evict (close) them. The suggested approach is to leverage the existing CredentialsProvider and add support for streaming credentials to handle token refresh scenarios. Each time a new token is received connection is reauthenticated.
ggivo
force-pushed
the
token-based-auth
branch
from
December 18, 2024 10:05
432c4f9
to
528e329
Compare
Verify authentication using Azure AD with service principals
…upportsStreaming()
ggivo
force-pushed
the
token-based-auth
branch
from
December 18, 2024 10:16
528e329
to
0e0f502
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This PR Provides the required changes to integrate the token based authentication using the
core
module from redis-authx.TokenBasedRedisCredentialsProvider is the main component which handles the id provider creation and management as well as glueing the renewal process to lettuce connection management.
An instance of
TokenBasedRedisCredentialsProvider
should be provided to Letuce connection through respectiveRedisUri
. In addtionClientOptions.ReauthenticateBehavior.ON_NEW_CREDENTIALS
should be configured on theRedisClient
TokenBasedRedisCredentialsProvider
lifecycle is not controlled by the RedisClient itself and need to me managed externaly.TokenBasedRedisCredentialsProvider.shutdown()
method need to be invoked once no longer needed to stop renewing tokens.The configuration and creation of TokenBasedRedisCredentialsProvider is achieved through identity provider-specific configuration builders.
MS EntraID identity provider is already provided within redis-authx.
A basic usage would look like;
Make sure that:
mvn formatter:format
target. Don’t submit any formatting related changes.