Google Cloud Storage C++ Client 2.13.0
A C++ Client Library for Google Cloud Storage
|
Interface for OAuth 2.0 credentials used to access Google Cloud services. More...
#include <google/cloud/storage/oauth2/credentials.h>
Public Member Functions | |
virtual | ~Credentials ()=default |
virtual StatusOr< std::string > | AuthorizationHeader ()=0 |
Attempts to obtain a value for the Authorization HTTP header. More... | |
virtual StatusOr< std::vector< std::uint8_t > > | SignBlob (SigningAccount const &service_account, std::string const &string_to_sign) const |
Try to sign string_to_sign using service_account . More... | |
virtual std::string | AccountEmail () const |
Return the account's email associated with these credentials, if any. More... | |
virtual std::string | KeyId () const |
Return the account's key_id associated with these credentials, if any. More... | |
Interface for OAuth 2.0 credentials used to access Google Cloud services.
Instantiating a specific kind of Credentials
should usually be done via the convenience methods declared in google_credentials.h.
|
virtualdefault |
|
inlinevirtual |
Return the account's email associated with these credentials, if any.
Reimplemented in google::cloud::storage::oauth2::ComputeEngineCredentials< HttpRequestBuilderType, ClockType >, and google::cloud::storage::oauth2::ServiceAccountCredentials< HttpRequestBuilderType, ClockType >.
|
pure virtual |
Attempts to obtain a value for the Authorization HTTP header.
If unable to obtain a value for the Authorization header, which could happen for Credentials
that need to be periodically refreshed, the underlying Status
will indicate failure details from the refresh HTTP request. Otherwise, the returned value will contain the Authorization header to be used in HTTP requests.
Implemented in google::cloud::storage::oauth2::AnonymousCredentials, google::cloud::storage::oauth2::AuthorizedUserCredentials< HttpRequestBuilderType, ClockType >, google::cloud::storage::oauth2::ComputeEngineCredentials< HttpRequestBuilderType, ClockType >, and google::cloud::storage::oauth2::ServiceAccountCredentials< HttpRequestBuilderType, ClockType >.
|
inlinevirtual |
Return the account's key_id associated with these credentials, if any.
Reimplemented in google::cloud::storage::oauth2::ServiceAccountCredentials< HttpRequestBuilderType, ClockType >.
|
virtual |
Try to sign string_to_sign
using service_account
.
Some Credentials types can locally sign a blob, most often just on behalf of an specific service account. This function returns an error if the credentials cannot sign the blob at all, or if the service account is a mismatch.
Reimplemented in google::cloud::storage::oauth2::ServiceAccountCredentials< HttpRequestBuilderType, ClockType >.