Credential Providers

AbstractCredentialProvider()

Abstract credential provider

UserPassCredentialProvider([username, password])

Credential provider that just returns a UserPassCredentialProvider.password and/or UserPassCredentialProvider.username.

UserPass(username, password)

Username/password tuple.

class AbstractCredentialProvider[source]

Abstract credential provider

abstract async get_credentials() UserPass[source]

Returns an instance of coredis.credentials.UserPass for establishing a connection to the redis server.

class UserPassCredentialProvider(username: str | None = None, password: str | None = None)[source]

Credential provider that just returns a UserPassCredentialProvider.password and/or UserPassCredentialProvider.username.

async get_credentials() UserPass[source]

Returns an instance of coredis.credentials.UserPass for establishing a connection to the redis server.

class UserPass(username: str, password: str)[source]

Username/password tuple.

username: str

Username

password: str

Password

class ElastiCacheIAMProvider(user: str, cluster_name: str, region: str = 'us-east-1')[source]

Credential provider that uses IAM authentication to connect to an Elasticache instance.

async get_credentials() UserPass[source]

Returns a short-lived token that can be used to connect to an IAM enabled Elasticache instance. The token will be cached for its lifetime (15 minutes) to avoid unnecessary requests.