Skip to content

Fixed a credential refresh edge case#575

Open
chiaco wants to merge 1 commit into
aliyun:masterfrom
chiaco:patch-1
Open

Fixed a credential refresh edge case#575
chiaco wants to merge 1 commit into
aliyun:masterfrom
chiaco:patch-1

Conversation

@chiaco

@chiaco chiaco commented Nov 19, 2025

Copy link
Copy Markdown

The current code treats "no cached credentials" and "credentials about to expire" as the same condition. The problem is that it tries to refresh the soon-to-expire credentials, and blindly overrides the current value. This is a problem because the refresh can (and has failed on us), while the existing credentials would still otherwise have been valid. It overwrites the existing "good" credentials with a null value, when it didn't need to.

This pull request changes it so it only replaces the existing credentials only if the new credentials are actually valid.

The current code treats "no cached credentials" and "credentials about to expire" as the same condition. The problem is that it tries to refresh the soon-to-expire credentials, and blindly overrides the current value. This is a problem because the refresh can (and has failed on us), while the existing credentials would still otherwise have been valid. It overwrites the existing "good" credentials with a null value, when it didn't need to.

This pull request changes it so it only replaces the existing credentials only if the new credentials are actually valid.
@CLAassistant

CLAassistant commented Nov 19, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@chiaco

chiaco commented Nov 19, 2025

Copy link
Copy Markdown
Author

@huiguangjun Hey, I found your name as a reviewer in other recently merged pull requests. We've never met, but I was hoping you could take a look at this one. It's quick and easy to understand and review :)

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

Successfully merging this pull request may close these issues.

2 participants