diff --git a/dev_requirements.txt b/dev_requirements.txt index 945afc35dc..41cd08e166 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -16,4 +16,4 @@ uvloop vulture>=2.3.0 wheel>=0.30.0 numpy>=1.24.0 -redispy-entraid-credentials @ git+https://github.com/redis-developer/redispy-entra-credentials.git/@main +redis-entraid @ git+https://github.com/redis-developer/redispy-entra-credentials.git/@main diff --git a/docs/advanced_features.rst b/docs/advanced_features.rst index de645bd764..e6bed9b94d 100644 --- a/docs/advanced_features.rst +++ b/docs/advanced_features.rst @@ -466,3 +466,36 @@ command is received. >>> with r.monitor() as m: >>> for command in m.listen(): >>> print(command) + + +Token-based authentication +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Since redis-py version 5.3.0 new StreamableCredentialProvider interface was introduced. +This interface describes a CredentialProvider with an ability to stream an events that will be handled by listener. + +To keep redis-py with minimal dependencies needed to run it, we decided to separate StreamableCredentialProvider +implementations in a separate packages. So If you're interested to try this feature please add them as a separate +dependency to your project. + +`EntraIdCredentialProvider` is a first implementation that allows you to integrate redis-py with Azure Cache for Redis +service. It will allows you to obtain a tokens from Microsoft EntraID and authenticate/re-authenticate your connections +with it in a background mode. + +To get `EntraIdCredentialProvider` you need to install following package: + +`pip install redispy-entraid-credentials` + +To setup a credential provider, first you have to create and configure an IdentityProvider and provide +TokenAuthConfig object. +`Here's a quick guide how to do this +`_ + +Now all you have to do is to pass an instance of `EntraIdCredentialProvider` via constructor, +available for sync and async clients: + +.. code:: python + + >>> cred_provider = EntraIdCredentialProvider(auth_config) + >>> r = Redis(credential_provider=cred_provider) + >>> r.ping() diff --git a/setup.py b/setup.py index ee3a7c2023..1a43ad7bdb 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ long_description_content_type="text/markdown", keywords=["Redis", "key-value store", "database"], license="MIT", - version="5.1.1", + version="5.3.0b1", packages=find_packages( include=[ "redis",