Skip to content
5 changes: 4 additions & 1 deletion google/cloud/storage/oauth2/anonymous_credentials.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ namespace oauth2 {
*
* @deprecated Prefer using the unified credentials documented in @ref guac
*/
class AnonymousCredentials : public Credentials {
class GOOGLE_CLOUD_CPP_DEPRECATED(
"This class will be removed in v4.0.0 and later. "
"Prefer using the unified credentials "
"documented in @ref guac.") AnonymousCredentials : public Credentials {
public:
AnonymousCredentials() = default;

Expand Down
24 changes: 19 additions & 5 deletions google/cloud/storage/oauth2/authorized_user_credentials.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ namespace oauth2 {
*
* @deprecated Prefer using the unified credentials documented in @ref guac
*/
struct AuthorizedUserCredentialsInfo {
struct GOOGLE_CLOUD_CPP_DEPRECATED(
"This struct will be removed in v4.0.0 and later. Prefer using the "
"unified credentials documented in @ref guac.")
AuthorizedUserCredentialsInfo {
std::string client_id;
std::string client_secret;
std::string refresh_token;
Expand All @@ -60,6 +63,9 @@ struct AuthorizedUserCredentialsInfo {
*
* @deprecated Prefer using the unified credentials documented in @ref guac
*/
GOOGLE_CLOUD_CPP_DEPRECATED(
"This function will be removed in v4.0.0 and later. Prefer using the "
"unified credentials documented in @ref guac.")
StatusOr<RefreshingCredentialsWrapper::TemporaryToken>
ParseAuthorizedUserRefreshResponse(
storage::internal::HttpResponse const& response,
Expand All @@ -70,6 +76,9 @@ ParseAuthorizedUserRefreshResponse(
*
* @deprecated Prefer using the unified credentials documented in @ref guac
*/
GOOGLE_CLOUD_CPP_DEPRECATED(
"This function will be removed in v4.0.0 and later. Prefer using the "
"unified credentials documented in @ref guac.")
StatusOr<AuthorizedUserCredentialsInfo> ParseAuthorizedUserCredentials(
std::string const& content, std::string const& source,
std::string const& default_token_uri =
Expand Down Expand Up @@ -106,9 +115,11 @@ class AuthorizedUserCredentials;

/// @copydoc AuthorizedUserCredentials
template <>
class AuthorizedUserCredentials<storage::internal::CurlRequestBuilder,
std::chrono::system_clock>
: public Credentials {
class GOOGLE_CLOUD_CPP_DEPRECATED(
"This class will be removed in v4.0.0 and later. Prefer using the "
"unified credentials documented in @ref guac.")
AuthorizedUserCredentials<storage::internal::CurlRequestBuilder,
std::chrono::system_clock> : public Credentials {
public:
explicit AuthorizedUserCredentials(
AuthorizedUserCredentialsInfo const& info,
Expand Down Expand Up @@ -138,7 +149,10 @@ class AuthorizedUserCredentials<storage::internal::CurlRequestBuilder,

/// @copydoc AuthorizedUserCredentials
template <typename HttpRequestBuilderType, typename ClockType>
class AuthorizedUserCredentials : public Credentials {
class GOOGLE_CLOUD_CPP_DEPRECATED(
"This class will be removed in v4.0.0 and later. Prefer using the "
"unified credentials documented in @ref guac.") AuthorizedUserCredentials
: public Credentials {
public:
explicit AuthorizedUserCredentials(AuthorizedUserCredentialsInfo info,
ChannelOptions const& channel_options = {})
Expand Down
22 changes: 18 additions & 4 deletions google/cloud/storage/oauth2/compute_engine_credentials.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ namespace oauth2 {
*
* @deprecated Prefer using the unified credentials documented in @ref guac
*/
struct ServiceAccountMetadata {
struct GOOGLE_CLOUD_CPP_DEPRECATED(
"This struct will be removed in v4.0.0 and later. Prefer using the "
"unified credentials documented in @ref guac.") ServiceAccountMetadata {
std::set<std::string> scopes;
std::string email;
};
Expand All @@ -57,6 +59,9 @@ struct ServiceAccountMetadata {
*
* @deprecated Prefer using the unified credentials documented in @ref guac
*/
GOOGLE_CLOUD_CPP_DEPRECATED(
"This function will be removed in v4.0.0 and later. Prefer using the "
"unified credentials documented in @ref guac.")
StatusOr<ServiceAccountMetadata> ParseMetadataServerResponse(
storage::internal::HttpResponse const& response);

Expand All @@ -67,6 +72,9 @@ StatusOr<ServiceAccountMetadata> ParseMetadataServerResponse(
*
* @deprecated Prefer using the unified credentials documented in @ref guac
*/
GOOGLE_CLOUD_CPP_DEPRECATED(
"This function will be removed in v4.0.0 and later. Prefer using the "
"unified credentials documented in @ref guac.")
StatusOr<RefreshingCredentialsWrapper::TemporaryToken>
ParseComputeEngineRefreshResponse(
storage::internal::HttpResponse const& response,
Expand Down Expand Up @@ -104,8 +112,11 @@ class ComputeEngineCredentials;

/// @copydoc ComputeEngineCredentials
template <>
class ComputeEngineCredentials<storage::internal::CurlRequestBuilder,
std::chrono::system_clock> : public Credentials {
class GOOGLE_CLOUD_CPP_DEPRECATED(
"This class will be removed in v4.0.0 and later. Prefer using the "
"unified credentials documented in @ref guac.")
ComputeEngineCredentials<storage::internal::CurlRequestBuilder,
std::chrono::system_clock> : public Credentials {
public:
explicit ComputeEngineCredentials() : ComputeEngineCredentials("default") {}
explicit ComputeEngineCredentials(std::string service_account_email);
Expand Down Expand Up @@ -152,7 +163,10 @@ class ComputeEngineCredentials<storage::internal::CurlRequestBuilder,

/// @copydoc ComputeEngineCredentials
template <typename HttpRequestBuilderType, typename ClockType>
class ComputeEngineCredentials : public Credentials {
class GOOGLE_CLOUD_CPP_DEPRECATED(
"This class will be removed in v4.0.0 and later. Prefer using the "
"unified credentials documented in @ref guac.") ComputeEngineCredentials
: public Credentials {
public:
explicit ComputeEngineCredentials() : ComputeEngineCredentials("default") {}

Expand Down
20 changes: 18 additions & 2 deletions google/cloud/storage/oauth2/credential_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,21 @@ namespace oauth2 {
*
* @deprecated Prefer using the unified credentials documented in @ref guac
*/
// NOLINTNEXTLINE(readability-identifier-naming)
enum class JwtSigningAlgorithms { RS256 };
enum class GOOGLE_CLOUD_CPP_DEPRECATED(
"This enum will be removed in v4.0.0 and later. Prefer using the unified "
"credentials documented in @ref guac.") JwtSigningAlgorithms {
// NOLINTNEXTLINE(readability-identifier-naming)
RS256
};

/**
* The max lifetime in seconds of an access token.
*
* @deprecated Prefer using the unified credentials documented in @ref guac
*/
GOOGLE_CLOUD_CPP_DEPRECATED(
"This constant will be removed in v4.0.0 and later. Prefer using the "
"unified credentials documented in @ref guac.")
constexpr std::chrono::seconds GoogleOAuthAccessTokenLifetime() {
return std::chrono::seconds(3600);
}
Expand All @@ -55,6 +62,9 @@ constexpr std::chrono::seconds GoogleOAuthAccessTokenLifetime() {
*
* @deprecated Prefer using the unified credentials documented in @ref guac
*/
GOOGLE_CLOUD_CPP_DEPRECATED(
"This constant will be removed in v4.0.0 and later. Prefer using the "
"unified credentials documented in @ref guac.")
constexpr std::chrono::seconds GoogleOAuthAccessTokenExpirationSlack() {
return std::chrono::seconds(300);
}
Expand All @@ -64,6 +74,9 @@ constexpr std::chrono::seconds GoogleOAuthAccessTokenExpirationSlack() {
*
* @deprecated Prefer using the unified credentials documented in @ref guac
*/
GOOGLE_CLOUD_CPP_DEPRECATED(
"This constant will be removed in v4.0.0 and later. Prefer using the "
"unified credentials documented in @ref guac.")
inline char const* GoogleOAuthRefreshEndpoint() {
static constexpr char kEndpoint[] = "https://oauth2.googleapis.com/token";
return kEndpoint;
Expand All @@ -74,6 +87,9 @@ inline char const* GoogleOAuthRefreshEndpoint() {
*
* @deprecated Prefer using the unified credentials documented in @ref guac
*/
GOOGLE_CLOUD_CPP_DEPRECATED(
"This constant will be removed in v4.0.0 and later. Prefer using the "
"unified credentials documented in @ref guac.")
inline char const* GoogleOAuthScopeCloudPlatform() {
static constexpr char kScope[] =
"https://www.googleapis.com/auth/cloud-platform";
Expand Down
4 changes: 3 additions & 1 deletion google/cloud/storage/oauth2/credentials.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ namespace oauth2 {
*
* @deprecated Prefer using the unified credentials documented in @ref guac
*/
class Credentials {
class GOOGLE_CLOUD_CPP_DEPRECATED(
"This class will be removed in v4.0.0 and later. Prefer using the "
"unified credentials documented in @ref guac.") Credentials {
public:
virtual ~Credentials() = default;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ namespace oauth2 {
*
* @deprecated Prefer using the unified credentials documented in @ref guac
*/
GOOGLE_CLOUD_CPP_DEPRECATED(
"This function will be removed in v4.0.0 and later. Prefer using the "
"unified credentials documented in @ref guac.")
char const* GoogleAdcEnvVar();

/**
Expand All @@ -43,6 +46,9 @@ char const* GoogleAdcEnvVar();
*
* @deprecated Prefer using the unified credentials documented in @ref guac
*/
GOOGLE_CLOUD_CPP_DEPRECATED(
"This function will be removed in v4.0.0 and later. Prefer using the "
"unified credentials documented in @ref guac.")
std::string GoogleAdcFilePathFromEnvVarOrEmpty();

/**
Expand All @@ -54,6 +60,9 @@ std::string GoogleAdcFilePathFromEnvVarOrEmpty();
*
* @deprecated Prefer using the unified credentials documented in @ref guac
*/
GOOGLE_CLOUD_CPP_DEPRECATED(
"This function will be removed in v4.0.0 and later. Prefer using the "
"unified credentials documented in @ref guac.")
std::string GoogleAdcFilePathFromWellKnownPathOrEmpty();

/**
Expand All @@ -64,6 +73,9 @@ std::string GoogleAdcFilePathFromWellKnownPathOrEmpty();
*
* @deprecated Prefer using the unified credentials documented in @ref guac
*/
GOOGLE_CLOUD_CPP_DEPRECATED(
"This function will be removed in v4.0.0 and later. Prefer using the "
"unified credentials documented in @ref guac.")
char const* GoogleGcloudAdcFileEnvVar();

/**
Expand All @@ -76,6 +88,9 @@ char const* GoogleGcloudAdcFileEnvVar();
*
* @deprecated Prefer using the unified credentials documented in @ref guac
*/
GOOGLE_CLOUD_CPP_DEPRECATED(
"This function will be removed in v4.0.0 and later. Prefer using the "
"unified credentials documented in @ref guac.")
char const* GoogleAdcHomeEnvVar();

} // namespace oauth2
Expand Down
Loading
Loading