Closed nakedible-p closed 2 months ago
@aembke This is currently basically just a sample, or proof of concept, of what the implementation could be. There's no tests, no sentinel support, etc. But I want to put this out early to you to see if there's a chance that something like this could be merged and to get early feedback on the design.
Hi @nakedible-p, thanks for putting that together. This looks good so I'm happy to merge it behind a new FF sometime this week. I'll cherry-pick this into a working branch and try out a few tests. I might make a few cosmetic changes, such as using a trait object similar to Arc<dyn Resolve>
and Arc<dyn ReplicaFilter>
, but overall this looks good.
Okay, happy to hand it over as is. You know best what fits in your codebase so it's more efficient that way. All code submitted under CC0, so feel free to do with it as you please. Or if you want me to refine it further, just let me know what you need, happy to do that as well. And disclaimer: 100% untested at this point. I think probably the Debug trait thing is a bit wrong right now.
One question just came to mind - in some cases with clusters it's common for many connections to be created at once. Do you have any preference on whether the client should call the creds callback once for each connection, or just once per cluster sync, or maybe even just once per some interval (combined with some kind of caching perhaps)?
Once for each connection. It's easy enough to build the caching / whatever logic on the credential provider side if necessary.
In practice, with AWS, a token in just in-memory calculation based on the current AWS credentials, so it's cheap to do even if it happens a lot.
Thanks @nakedible-p, this will be cherry-picked and added in https://github.com/aembke/fred.rs/pull/288
This is a draft of the changes to add credential provider support. Not meant to be merged before further work.
Usage would be something like:
Fixes #284