Skip to content

Control refresh of credentials - when Credentials::default() doesn't work #439

@kolstae

Description

@kolstae

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.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions