Google Cloud Storage C++ Client
1.42.0
A C++ Client Library for Google Cloud Storage
|
A Credentials
type representing "anonymous" Google OAuth2.0 credentials.
More...
#include <google/cloud/storage/oauth2/anonymous_credentials.h>
Public Member Functions | |
AnonymousCredentials ()=default | |
StatusOr< std::string > | AuthorizationHeader () override |
While other Credentials subclasses return a string containing an Authorization HTTP header from this method, this class always returns an empty string as its value. 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... | |
A Credentials
type representing "anonymous" Google OAuth2.0 credentials.
This is only useful in two cases: (a) in testing, where you want to access a test bench without having to worry about authentication or SSL setup, and (b) when accessing publicly readable resources (e.g. a Google Cloud Storage object that is readable by the "allUsers" entity), which requires no authentication or authorization.
Definition at line 37 of file anonymous_credentials.h.
|
default |
|
inlinevirtualinherited |
Return the account's email associated with these credentials, if any.
Reimplemented in google::cloud::storage::oauth2::ServiceAccountCredentials< HttpRequestBuilderType, ClockType >, and google::cloud::storage::oauth2::ComputeEngineCredentials< HttpRequestBuilderType, ClockType >.
Definition at line 67 of file credentials.h.
|
overridevirtual |
While other Credentials subclasses return a string containing an Authorization HTTP header from this method, this class always returns an empty string as its value.
Implements google::cloud::storage::oauth2::Credentials.
|
inlinevirtualinherited |
Return the account's key_id associated with these credentials, if any.
Reimplemented in google::cloud::storage::oauth2::ServiceAccountCredentials< HttpRequestBuilderType, ClockType >.
Definition at line 70 of file credentials.h.
|
virtualinherited |
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 >.