Skip to content

Commit

Permalink
Updated package name, added docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vladvildanov committed Dec 20, 2024
1 parent 40e5fc1 commit 03b7063
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
33 changes: 33 additions & 0 deletions docs/advanced_features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
<https://github.com/redis-developer/redispy-entra-credentials?tab=readme-ov-file#usage>`_

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()
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 03b7063

Please sign in to comment.