Wrapper for refreshable parts of a Credentials object.
Constructors
RefreshingCredentialsWrapper()
Functions
AuthorizationHeader(std::chrono::system_clock::time_point, RefreshFunctor) const
Parameters | |
---|---|
Name | Description |
|
std::chrono::system_clock::time_point
|
refresh_fn |
RefreshFunctor
|
typename RefreshFunctor |
|
Returns | |
---|---|
Type | Description |
StatusOr< std::string > |
IsExpired(std::chrono::system_clock::time_point) const
Returns whether the current access token should be considered expired.
When determining if a Credentials object needs to be refreshed, the IsValid method should be used instead; there may be cases where a Credentials is not expired but should be considered invalid.
If a Credentials is close to expiration but not quite expired, this method may still return false. This helps prevent the case where an access token expires between when it is obtained and when it is used.
Parameter | |
---|---|
Name | Description |
now |
std::chrono::system_clock::time_point
|
Returns | |
---|---|
Type | Description |
bool |
IsValid(std::chrono::system_clock::time_point) const
Returns whether the current access token should be considered valid.
This method should be used to determine whether a Credentials object needs to be refreshed.
Parameter | |
---|---|
Name | Description |
now |
std::chrono::system_clock::time_point
|
Returns | |
---|---|
Type | Description |
bool |