Class RefreshingCredentialsWrapper (2.19.0)

Wrapper for refreshable parts of a Credentials object.

Constructors

RefreshingCredentialsWrapper()

Functions

AuthorizationHeader(std::chrono::system_clock::time_point, RefreshFunctor) const

Parameters
NameDescription
std::chrono::system_clock::time_point
refresh_fn RefreshFunctor
typename RefreshFunctor
Returns
TypeDescription
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
NameDescription
now std::chrono::system_clock::time_point
Returns
TypeDescription
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
NameDescription
now std::chrono::system_clock::time_point
Returns
TypeDescription
bool