-
Notifications
You must be signed in to change notification settings - Fork 229
Description
Is your feature request related to a problem? Please describe.
I have long running tasks using AWS Batch where I need to use Credentials::from_instance_metadata(false) to get the correct credentials. When the credentials are refreshed (using Credentials::default()), the wrong credentials are set and the job fails. The current Bucket::set_credentials() creates a new Arc causing all clones to need to be refreshed as well, and requires &mut self which makes it awkward IMO.
Describe the solution you'd like
It would be great if the refresh-method was part of the credentials, but I don't see how to achieve that. Mainly because of serde, but also backwards compatibility.
Describe alternatives you've considered
I've created a branch where I have introduced Bucket::refresh_credentials(...) as a work around, and that does work. However it's a bit clunky to use as it must be called prior to any call using the credentials.