Google Cloud Storage C++ Client
1.42.0
A C++ Client Library for Google Cloud Storage
|
Wrapper class for Google OAuth 2.0 service account credentials. More...
#include <google/cloud/storage/oauth2/service_account_credentials.h>
Public Member Functions | |
ServiceAccountCredentials (ServiceAccountCredentialsInfo info) | |
ServiceAccountCredentials (ServiceAccountCredentialsInfo info, ChannelOptions const &options) | |
StatusOr< std::string > | AuthorizationHeader () override |
Attempts to obtain a value for the Authorization HTTP header. More... | |
StatusOr< std::vector< std::uint8_t > > | SignBlob (SigningAccount const &signing_account, std::string const &blob) const override |
Create a RSA SHA256 signature of the blob using the Credential object. More... | |
std::string | AccountEmail () const override |
Return the account's email associated with these credentials, if any. More... | |
std::string | KeyId () const override |
Return the account's key_id associated with these credentials, if any. More... | |
Wrapper class for Google OAuth 2.0 service account credentials.
Takes a ServiceAccountCredentialsInfo and obtains access tokens from the Google Authorization Service as needed. Instances of this class should usually be created via the convenience methods declared in google_credentials.h.
An HTTP Authorization header, with an access token as its value, can be obtained by calling the AuthorizationHeader() method; if the current access token is invalid or nearing expiration, this will class will first obtain a new access token before returning the Authorization header string.
HttpRequestBuilderType | a dependency injection point. It makes it possible to mock internal libcurl wrappers. This should generally not be overridden except for testing. |
ClockType | a dependency injection point to fetch the current time. This should generally not be overridden except for testing. |
Definition at line 137 of file service_account_credentials.h.
|
inlineexplicit |
Definition at line 139 of file service_account_credentials.h.
|
inline |
Definition at line 141 of file service_account_credentials.h.
|
inlineoverridevirtual |
Return the account's email associated with these credentials, if any.
Reimplemented from google::cloud::storage::oauth2::Credentials.
Definition at line 177 of file service_account_credentials.h.
|
inlineoverridevirtual |
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.
Implements google::cloud::storage::oauth2::Credentials.
Definition at line 147 of file service_account_credentials.h.
|
inlineoverridevirtual |
Return the account's key_id associated with these credentials, if any.
Reimplemented from google::cloud::storage::oauth2::Credentials.
Definition at line 178 of file service_account_credentials.h.
|
inlineoverridevirtual |
Create a RSA SHA256 signature of the blob using the Credential object.
signing_account | the desired service account which should sign blob . If not set, uses this object's account. If set, it must match this object's service account. |
blob | the string to sign. Note that sometimes the application must Base64-encode the data before signing. |
signing_account
does not match the email for the credential's account. Reimplemented from google::cloud::storage::oauth2::Credentials.
Definition at line 164 of file service_account_credentials.h.