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

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

Detailed Description

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.

Deprecated:
Prefer using the unified credentials documented in Authentication Components

Constructor & Destructor Documentation

◆ AnonymousCredentials()

google::cloud::storage::oauth2::AnonymousCredentials::AnonymousCredentials ( )
default

Member Function Documentation

◆ AccountEmail()

virtual std::string google::cloud::storage::oauth2::Credentials::AccountEmail ( ) const
inlinevirtualinherited

◆ AuthorizationHeader()

StatusOr< std::string > google::cloud::storage::oauth2::AnonymousCredentials::AuthorizationHeader ( )
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.

◆ KeyId()

virtual std::string google::cloud::storage::oauth2::Credentials::KeyId ( ) const
inlinevirtualinherited

Return the account's key_id associated with these credentials, if any.

Deprecated:
Prefer using the unified credentials documented in Authentication Components

Reimplemented in google::cloud::storage::oauth2::ServiceAccountCredentials< HttpRequestBuilderType, ClockType >.

◆ SignBlob()

virtual StatusOr< std::vector< std::uint8_t > > google::cloud::storage::oauth2::Credentials::SignBlob ( SigningAccount const &  service_account,
std::string const &  string_to_sign 
) const
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.

Deprecated:
Prefer using the unified credentials documented in Authentication Components

Reimplemented in google::cloud::storage::oauth2::ServiceAccountCredentials< HttpRequestBuilderType, ClockType >.