Reputation:
I'm trying to use the AWS Elasticache with node redis client and I'm able to generate an IAM token and use it as a password. During the token creation I need to pass the expiration time for the token for e.g 60 secs. I use this token during the 60 secs time frame and it works.
Now I've the following question - What happens if after these 60 secs I'm able to connect to redis and after words the connection fails for some reason? AFAIK, the redis client will retry to reconnect with the retry strategy.
Does reconnecting imply re-authentication? Will it work with the expired token? If not, is it possible to update the password (with a fresh token) during the error/reconnection event with node-redis client? Is there any redis client for nodejs able to handle such IAM authentication/re-authentication mechanism out of the box?
Upvotes: 0
Views: 966
Reputation: 36
ioredis does not support credential providers currently: https://github.com/redis/ioredis/issues/1738 . That GitHub issue has some code that hacks a credential provider using the connector API, nothing pretty but it does the job.
Upvotes: 0