Skip to content

Commit 2e9d1b6

Browse files
shubham-up-47scotthart
authored andcommitted
deprecate(storage): Mark google::cloud::storage::oauth2 as deprecated (#15139)
1 parent ac08c35 commit 2e9d1b6

9 files changed

+172
-21
lines changed

google/cloud/storage/oauth2/anonymous_credentials.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ namespace oauth2 {
3636
*
3737
* @deprecated Prefer using the unified credentials documented in @ref guac
3838
*/
39-
class AnonymousCredentials : public Credentials {
39+
class GOOGLE_CLOUD_CPP_DEPRECATED(
40+
"This class will be removed in v4.0.0 and later. "
41+
"Prefer using the unified credentials "
42+
"documented in @ref guac.") AnonymousCredentials : public Credentials {
4043
public:
4144
AnonymousCredentials() = default;
4245

google/cloud/storage/oauth2/authorized_user_credentials.h

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ namespace oauth2 {
4545
*
4646
* @deprecated Prefer using the unified credentials documented in @ref guac
4747
*/
48-
struct AuthorizedUserCredentialsInfo {
48+
struct GOOGLE_CLOUD_CPP_DEPRECATED(
49+
"This struct will be removed in v4.0.0 and later. Prefer using the "
50+
"unified credentials documented in @ref guac.")
51+
AuthorizedUserCredentialsInfo {
4952
std::string client_id;
5053
std::string client_secret;
5154
std::string refresh_token;
@@ -60,6 +63,9 @@ struct AuthorizedUserCredentialsInfo {
6063
*
6164
* @deprecated Prefer using the unified credentials documented in @ref guac
6265
*/
66+
GOOGLE_CLOUD_CPP_DEPRECATED(
67+
"This function will be removed in v4.0.0 and later. Prefer using the "
68+
"unified credentials documented in @ref guac.")
6369
StatusOr<RefreshingCredentialsWrapper::TemporaryToken>
6470
ParseAuthorizedUserRefreshResponse(
6571
storage::internal::HttpResponse const& response,
@@ -70,6 +76,9 @@ ParseAuthorizedUserRefreshResponse(
7076
*
7177
* @deprecated Prefer using the unified credentials documented in @ref guac
7278
*/
79+
GOOGLE_CLOUD_CPP_DEPRECATED(
80+
"This function will be removed in v4.0.0 and later. Prefer using the "
81+
"unified credentials documented in @ref guac.")
7382
StatusOr<AuthorizedUserCredentialsInfo> ParseAuthorizedUserCredentials(
7483
std::string const& content, std::string const& source,
7584
std::string const& default_token_uri =
@@ -106,9 +115,11 @@ class AuthorizedUserCredentials;
106115

107116
/// @copydoc AuthorizedUserCredentials
108117
template <>
109-
class AuthorizedUserCredentials<storage::internal::CurlRequestBuilder,
110-
std::chrono::system_clock>
111-
: public Credentials {
118+
class GOOGLE_CLOUD_CPP_DEPRECATED(
119+
"This class will be removed in v4.0.0 and later. Prefer using the "
120+
"unified credentials documented in @ref guac.")
121+
AuthorizedUserCredentials<storage::internal::CurlRequestBuilder,
122+
std::chrono::system_clock> : public Credentials {
112123
public:
113124
explicit AuthorizedUserCredentials(
114125
AuthorizedUserCredentialsInfo const& info,
@@ -138,7 +149,10 @@ class AuthorizedUserCredentials<storage::internal::CurlRequestBuilder,
138149

139150
/// @copydoc AuthorizedUserCredentials
140151
template <typename HttpRequestBuilderType, typename ClockType>
141-
class AuthorizedUserCredentials : public Credentials {
152+
class GOOGLE_CLOUD_CPP_DEPRECATED(
153+
"This class will be removed in v4.0.0 and later. Prefer using the "
154+
"unified credentials documented in @ref guac.") AuthorizedUserCredentials
155+
: public Credentials {
142156
public:
143157
explicit AuthorizedUserCredentials(AuthorizedUserCredentialsInfo info,
144158
ChannelOptions const& channel_options = {})

google/cloud/storage/oauth2/compute_engine_credentials.h

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ namespace oauth2 {
4747
*
4848
* @deprecated Prefer using the unified credentials documented in @ref guac
4949
*/
50-
struct ServiceAccountMetadata {
50+
struct GOOGLE_CLOUD_CPP_DEPRECATED(
51+
"This struct will be removed in v4.0.0 and later. Prefer using the "
52+
"unified credentials documented in @ref guac.") ServiceAccountMetadata {
5153
std::set<std::string> scopes;
5254
std::string email;
5355
};
@@ -57,6 +59,9 @@ struct ServiceAccountMetadata {
5759
*
5860
* @deprecated Prefer using the unified credentials documented in @ref guac
5961
*/
62+
GOOGLE_CLOUD_CPP_DEPRECATED(
63+
"This function will be removed in v4.0.0 and later. Prefer using the "
64+
"unified credentials documented in @ref guac.")
6065
StatusOr<ServiceAccountMetadata> ParseMetadataServerResponse(
6166
storage::internal::HttpResponse const& response);
6267

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

105113
/// @copydoc ComputeEngineCredentials
106114
template <>
107-
class ComputeEngineCredentials<storage::internal::CurlRequestBuilder,
108-
std::chrono::system_clock> : public Credentials {
115+
class GOOGLE_CLOUD_CPP_DEPRECATED(
116+
"This class will be removed in v4.0.0 and later. Prefer using the "
117+
"unified credentials documented in @ref guac.")
118+
ComputeEngineCredentials<storage::internal::CurlRequestBuilder,
119+
std::chrono::system_clock> : public Credentials {
109120
public:
110121
explicit ComputeEngineCredentials() : ComputeEngineCredentials("default") {}
111122
explicit ComputeEngineCredentials(std::string service_account_email);
@@ -152,7 +163,10 @@ class ComputeEngineCredentials<storage::internal::CurlRequestBuilder,
152163

153164
/// @copydoc ComputeEngineCredentials
154165
template <typename HttpRequestBuilderType, typename ClockType>
155-
class ComputeEngineCredentials : public Credentials {
166+
class GOOGLE_CLOUD_CPP_DEPRECATED(
167+
"This class will be removed in v4.0.0 and later. Prefer using the "
168+
"unified credentials documented in @ref guac.") ComputeEngineCredentials
169+
: public Credentials {
156170
public:
157171
explicit ComputeEngineCredentials() : ComputeEngineCredentials("default") {}
158172

google/cloud/storage/oauth2/credential_constants.h

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,21 @@ namespace oauth2 {
3232
*
3333
* @deprecated Prefer using the unified credentials documented in @ref guac
3434
*/
35-
// NOLINTNEXTLINE(readability-identifier-naming)
36-
enum class JwtSigningAlgorithms { RS256 };
35+
enum class GOOGLE_CLOUD_CPP_DEPRECATED(
36+
"This enum will be removed in v4.0.0 and later. Prefer using the unified "
37+
"credentials documented in @ref guac.") JwtSigningAlgorithms {
38+
// NOLINTNEXTLINE(readability-identifier-naming)
39+
RS256
40+
};
3741

3842
/**
3943
* The max lifetime in seconds of an access token.
4044
*
4145
* @deprecated Prefer using the unified credentials documented in @ref guac
4246
*/
47+
GOOGLE_CLOUD_CPP_DEPRECATED(
48+
"This constant will be removed in v4.0.0 and later. Prefer using the "
49+
"unified credentials documented in @ref guac.")
4350
constexpr std::chrono::seconds GoogleOAuthAccessTokenLifetime() {
4451
return std::chrono::seconds(3600);
4552
}
@@ -55,6 +62,9 @@ constexpr std::chrono::seconds GoogleOAuthAccessTokenLifetime() {
5562
*
5663
* @deprecated Prefer using the unified credentials documented in @ref guac
5764
*/
65+
GOOGLE_CLOUD_CPP_DEPRECATED(
66+
"This constant will be removed in v4.0.0 and later. Prefer using the "
67+
"unified credentials documented in @ref guac.")
5868
constexpr std::chrono::seconds GoogleOAuthAccessTokenExpirationSlack() {
5969
return std::chrono::seconds(300);
6070
}
@@ -64,6 +74,9 @@ constexpr std::chrono::seconds GoogleOAuthAccessTokenExpirationSlack() {
6474
*
6575
* @deprecated Prefer using the unified credentials documented in @ref guac
6676
*/
77+
GOOGLE_CLOUD_CPP_DEPRECATED(
78+
"This constant will be removed in v4.0.0 and later. Prefer using the "
79+
"unified credentials documented in @ref guac.")
6780
inline char const* GoogleOAuthRefreshEndpoint() {
6881
static constexpr char kEndpoint[] = "https://oauth2.googleapis.com/token";
6982
return kEndpoint;
@@ -74,6 +87,9 @@ inline char const* GoogleOAuthRefreshEndpoint() {
7487
*
7588
* @deprecated Prefer using the unified credentials documented in @ref guac
7689
*/
90+
GOOGLE_CLOUD_CPP_DEPRECATED(
91+
"This constant will be removed in v4.0.0 and later. Prefer using the "
92+
"unified credentials documented in @ref guac.")
7793
inline char const* GoogleOAuthScopeCloudPlatform() {
7894
static constexpr char kScope[] =
7995
"https://www.googleapis.com/auth/cloud-platform";

google/cloud/storage/oauth2/credentials.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ namespace oauth2 {
4444
*
4545
* @deprecated Prefer using the unified credentials documented in @ref guac
4646
*/
47-
class Credentials {
47+
class GOOGLE_CLOUD_CPP_DEPRECATED(
48+
"This class will be removed in v4.0.0 and later. Prefer using the "
49+
"unified credentials documented in @ref guac.") Credentials {
4850
public:
4951
virtual ~Credentials() = default;
5052

google/cloud/storage/oauth2/google_application_default_credentials_file.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ namespace oauth2 {
3232
*
3333
* @deprecated Prefer using the unified credentials documented in @ref guac
3434
*/
35+
GOOGLE_CLOUD_CPP_DEPRECATED(
36+
"This function will be removed in v4.0.0 and later. Prefer using the "
37+
"unified credentials documented in @ref guac.")
3538
char const* GoogleAdcEnvVar();
3639

3740
/**
@@ -43,6 +46,9 @@ char const* GoogleAdcEnvVar();
4346
*
4447
* @deprecated Prefer using the unified credentials documented in @ref guac
4548
*/
49+
GOOGLE_CLOUD_CPP_DEPRECATED(
50+
"This function will be removed in v4.0.0 and later. Prefer using the "
51+
"unified credentials documented in @ref guac.")
4652
std::string GoogleAdcFilePathFromEnvVarOrEmpty();
4753

4854
/**
@@ -54,6 +60,9 @@ std::string GoogleAdcFilePathFromEnvVarOrEmpty();
5460
*
5561
* @deprecated Prefer using the unified credentials documented in @ref guac
5662
*/
63+
GOOGLE_CLOUD_CPP_DEPRECATED(
64+
"This function will be removed in v4.0.0 and later. Prefer using the "
65+
"unified credentials documented in @ref guac.")
5766
std::string GoogleAdcFilePathFromWellKnownPathOrEmpty();
5867

5968
/**
@@ -64,6 +73,9 @@ std::string GoogleAdcFilePathFromWellKnownPathOrEmpty();
6473
*
6574
* @deprecated Prefer using the unified credentials documented in @ref guac
6675
*/
76+
GOOGLE_CLOUD_CPP_DEPRECATED(
77+
"This function will be removed in v4.0.0 and later. Prefer using the "
78+
"unified credentials documented in @ref guac.")
6779
char const* GoogleGcloudAdcFileEnvVar();
6880

6981
/**
@@ -76,6 +88,9 @@ char const* GoogleGcloudAdcFileEnvVar();
7688
*
7789
* @deprecated Prefer using the unified credentials documented in @ref guac
7890
*/
91+
GOOGLE_CLOUD_CPP_DEPRECATED(
92+
"This function will be removed in v4.0.0 and later. Prefer using the "
93+
"unified credentials documented in @ref guac.")
7994
char const* GoogleAdcHomeEnvVar();
8095

8196
} // namespace oauth2

0 commit comments

Comments
 (0)