-
Notifications
You must be signed in to change notification settings - Fork 41
Description
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).
- Celery PR: Feature: Add support credential_provider to Redis Backend celery/celery#9879
- Kombu PR: Feat: add support for credential_provider to redis broker celery/kombu#2408
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!