Google Cloud Storage C++ Client 2.13.0
A C++ Client Library for Google Cloud Storage
|
Wrapper for refreshable parts of a Credentials object. More...
#include <google/cloud/storage/oauth2/refreshing_credentials_wrapper.h>
Classes | |
struct | TemporaryToken |
Public Member Functions | |
RefreshingCredentialsWrapper () | |
template<typename RefreshFunctor > | |
StatusOr< std::string > | AuthorizationHeader (std::chrono::system_clock::time_point, RefreshFunctor refresh_fn) const |
bool | IsExpired (std::chrono::system_clock::time_point now) const |
Returns whether the current access token should be considered expired. More... | |
bool | IsValid (std::chrono::system_clock::time_point now) const |
Returns whether the current access token should be considered valid. More... | |
Wrapper for refreshable parts of a Credentials object.
google::cloud::storage::oauth2::RefreshingCredentialsWrapper::RefreshingCredentialsWrapper | ( | ) |
|
inline |
bool google::cloud::storage::oauth2::RefreshingCredentialsWrapper::IsExpired | ( | std::chrono::system_clock::time_point | now | ) | 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.
bool google::cloud::storage::oauth2::RefreshingCredentialsWrapper::IsValid | ( | std::chrono::system_clock::time_point | now | ) | 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.