Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: reuse password tokens for their lifetime #688

Open
matt-domsch-sp opened this issue Nov 20, 2024 · 0 comments
Open

Feature request: reuse password tokens for their lifetime #688

matt-domsch-sp opened this issue Nov 20, 2024 · 0 comments

Comments

@matt-domsch-sp
Copy link

First, thank you for this work. We'd like to use it to eliminate needing to manually manage and rotate postgres passwords when in the AWS environment.

I'm concerned that because a new password token is generated on every point of need, that we will run into the AWS 200-per-second rate limit for our production uses, which will spin up dozens of ECS instances, each with upwards of 100 connections. This concern would be alleviated if password tokens were cached and reused until expiry.

I submitted a PR to the ruby-pg project to add fetching and caching directly there, but that maintainer rejected it as they're (unsurprisingly) not interested in having such AWS-specific code, which is also difficult to integration test, in that gem.

The key component here is the code to cache generated tokens. https://github.com/matt-domsch-sp/ruby-pg/blob/rds-iam-authentication/lib/pg/aws_iam_auth.rb

Could something similar be added to this gem to cache and reuse tokens until expiry?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant