Skip to content

feat(property-provider): memoize() supports force refresh #3413

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

Merged
merged 2 commits into from
Mar 16, 2022

Conversation

AllanZhengYP
Copy link
Contributor

Issue

The dynamic credentials are memoized for certain expiration. V3 SDK doesn't offer a way to force a refresh for credentials, however V2 supports it: in V2, one can simply do cred.get(callback) to force a refresh.

Description

This change provides a hash option with key forceRefresh: boolean in the resolved credentials provider function. By setting the key, the underlying credential provider will be invoked again in regardless of the current credentials' expiration. For example:

const client = new FooClient({});
//... needs a force refresh...
await client.config.credentials({ forceRefresh: true });
//... make more API calls...

Testing

Unit test


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@AllanZhengYP AllanZhengYP requested a review from a team as a code owner March 11, 2022 19:44
@AllanZhengYP AllanZhengYP requested a review from trivikr March 11, 2022 19:44
trivikr
trivikr previously approved these changes Mar 11, 2022
@AllanZhengYP AllanZhengYP merged commit a79f962 into aws:main Mar 16, 2022
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants