Closed bgoodman1695 closed 5 months ago
Duplicate of #821. It's on our roadmap, but no one started implementing it yet. You can use the workaround suggested in https://github.com/redis/node-redis/issues/821#issuecomment-1894291132 in the meantime.
Edit: BTW, do you think we should do it for password only or the whole configuration object?
I would lean towards the credentials (i.e. user / password) like other client implementations.
Motivation
Use case
Recently AWS introduced an option to connect to ElastiCache instances that are running Redis 7+, using IAM authentication: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/auth-iam.html
This poses a problem for the typical static
password
property, e.g. you might write an Elasticache/Redis client code with node-redis like:Proposed Solution
It would be useful if createClient could take in a callback for the
password
option, that may be invoked on reconnect attempts to properly refresh/regenerate a password in such scenarios where the password may be referring to a temporary auth string that must be refreshed on a TTL.Basic Code Example
No response