Closed
Description
Describe the bug
The condition of credential refresh doesn't get refreshed 5 minutes before expiry, as specified in the constructor:
as the refresh can only be made if
m_credentials.IsExpiredOrEmpty() == true
.
As a result, the token could pass the expiry check here but rejected by the endpoint milisecond later.
Regression Issue
- Select this option if this issue appears to be a regression.
Expected Behavior
Reference: class STSCredentialsProvider
:
Have a grace period. Refresh token minutes before expiry
Current Behavior
Refresh only when the credential is found to be expired during checking
Reproduction Steps
- Enable logging
- Create a connection to aws endpoint with
STSProfileCredentialsProvider.cpp
- Call some s3 api, e.g. ListObjectV2, per second
- By reading the log, it can be determined when does the refresh happen
Possible Solution
||
to &&
in the conditions
Additional Information/Context
No response
AWS CPP SDK version used
1.11.474
Compiler and Version used
gcc version 11.4.0
Operating System and version
Ubuntu 22.04