Google Cloud Storage C++ Client 2.13.0
A C++ Client Library for Google Cloud Storage
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
google::cloud::storage::oauth2::RefreshingCredentialsWrapper Class Reference

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...
 

Detailed Description

Wrapper for refreshable parts of a Credentials object.

Deprecated:
Prefer using the unified credentials documented in Authentication Components

Constructor & Destructor Documentation

◆ RefreshingCredentialsWrapper()

google::cloud::storage::oauth2::RefreshingCredentialsWrapper::RefreshingCredentialsWrapper ( )

Member Function Documentation

◆ AuthorizationHeader()

template<typename RefreshFunctor >
StatusOr< std::string > google::cloud::storage::oauth2::RefreshingCredentialsWrapper::AuthorizationHeader ( std::chrono::system_clock::time_point  ,
RefreshFunctor  refresh_fn 
) const
inline

◆ IsExpired()

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.

Deprecated:
Prefer using the unified credentials documented in Authentication Components

◆ IsValid()

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.

Deprecated:
Prefer using the unified credentials documented in Authentication Components