Skip to content

Add support for Redis credential_provider in URL #60

@SorianoMarmol

Description

@SorianoMarmol

First of all, thank you for maintaining this excellent library!

Background

Celery and Kombu are adding native support for Redis credential_provider parameter, which is essential for modern authentication methods like Azure Redis with Entra ID (formerly Azure AD).

Current Situation

It's currently possible to inject the credential provider using CELERY_SINGLETON_BACKEND_KWARGS:

CELERY_SINGLETON_BACKEND_KWARGS = {
    'credential_provider': MyCredentialProvider()
}

However, this creates two different ways of configuring the same thing across Celery, Kombu, and celery-singleton.

Problem

It would be ideal to configure it consistently using CELERY_SINGLETON_BACKEND_URL with credential_provider as a URL query parameter:

CELERY_SINGLETON_BACKEND_URL = 'rediss://host:6380/?credential_provider=module.MyCredentialProvider'

But this currently doesn't work because the credential_provider value is parsed as a string instead of being imported and instantiated as an object, resulting in:

AttributeError: 'str' object has no attribute 'get_credentials'

Suggestion
Option 1: Add support for parsing and instantiating credential_provider from URL parameters (to match Celery/Kombu behavior).
Option 2: At minimum, update the documentation with an example showing how to use CELERY_SINGLETON_BACKEND_KWARGS to inject the credential provider.

This would help users implement token-based authentication (Azure Entra ID, AWS IAM, etc.) consistently across their Celery stack.

Thanks a lot!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions