Skip to main content

Entra ID credentials provider implementation for Redis-py client

Project description

Installation

pip install redis-entraid

Usage

First you have to configure IdentityProvider, for this purpose there's 2 factory methods:

def create_provider_from_managed_identity(
        identity_type: ManagedIdentityType,
        resource: str,
        id_type: Optional[ManagedIdentityIdType] = None,
        id_value: Optional[str] = '',
        **kwargs
) -> EntraIDIdentityProvider

def create_provider_from_service_principal(
        client_credential,
        client_id: str,
        scopes: list = [],
        timeout: Optional[float] = None,
        token_kwargs: dict = {},
        **app_kwargs
) -> EntraIDIdentityProvider

This credential provider is running a scheduled background tasks to renew tokens, the specifics might be configured as well:

auth_config = TokenAuthConfig(idp)
cred_provider = EntraIdCredentialsProvider(auth_config)

To obtain token and run background task simply call:

# Sync
cred_provider.get_credentials()

# Async
await cred_provider.get_credentials_async()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

redis_entraid-0.1.0b1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

redis_entraid-0.1.0b1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file redis_entraid-0.1.0b1.tar.gz.

File metadata

  • Download URL: redis_entraid-0.1.0b1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for redis_entraid-0.1.0b1.tar.gz
Algorithm Hash digest
SHA256 16e04392eaaf05552374bf56120e4143fb2f90152d83354d3460a203b00a585f
MD5 596ed100f9628fbeeb504f05ec7677c2
BLAKE2b-256 4dc329f3c6959c24f4e79685500f5b0f0b3baaa7768c7c0391d462d421c7cd6a

See more details on using hashes here.

File details

Details for the file redis_entraid-0.1.0b1-py3-none-any.whl.

File metadata

File hashes

Hashes for redis_entraid-0.1.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 68c6ab7ad1ba269ef197576a1253a9e72ad448c8ef70a4b3ac4db7ccc95b34cf
MD5 3a4a05ecddd6d91466c933dd2cde65a0
BLAKE2b-256 6f594ea71b513f95285138df8e8fbc2857f3b25ade1b6fee1ac487202dc51b9e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page