Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fda5300

Browse filesBrowse files
authored
doc(storage): document all oauth2 names as deprecated (#10352)
Update the Doxygen comments to mark every type, function, and even the complete namespace as deprecated. In the next major release we will actually add the `[[deprecated]]` attribute, and (maybe) remove them in the major release following it.
1 parent 3ee9def commit fda5300
Copy full SHA for fda5300
Expand file treeCollapse file tree

10 files changed

+200
-30
lines changed

‎google/cloud/storage/oauth2/anonymous_credentials.h

Copy file name to clipboardExpand all lines: google/cloud/storage/oauth2/anonymous_credentials.h
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ namespace oauth2 {
3333
* (b) when accessing publicly readable resources (e.g. a Google Cloud Storage
3434
* object that is readable by the "allUsers" entity), which requires no
3535
* authentication or authorization.
36+
*
37+
* @deprecated Prefer using the unified credentials documented in @ref guac
3638
*/
3739
class AnonymousCredentials : public Credentials {
3840
public:

‎google/cloud/storage/oauth2/authorized_user_credentials.h

Copy file name to clipboardExpand all lines: google/cloud/storage/oauth2/authorized_user_credentials.h
+19-4Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,35 @@ namespace storage {
3636
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
3737
namespace oauth2 {
3838

39-
/// Object to hold information used to instantiate an AuthorizedUserCredentials.
39+
/**
40+
* Object to hold information used to instantiate an AuthorizedUserCredentials.
41+
*
42+
* @deprecated Prefer using the unified credentials documented in @ref guac
43+
*/
4044
struct AuthorizedUserCredentialsInfo {
4145
std::string client_id;
4246
std::string client_secret;
4347
std::string refresh_token;
4448
std::string token_uri;
4549
};
4650

47-
/// Parses a refresh response JSON string into an authorization header. The
48-
/// header and the current time (for the expiration) form a TemporaryToken.
51+
/**
52+
* Parses a refresh response JSON string into an authorization header.
53+
*
54+
* The header and the current time (for the expiration) form a TemporaryToken.
55+
*
56+
* @deprecated Prefer using the unified credentials documented in @ref guac
57+
*/
4958
StatusOr<RefreshingCredentialsWrapper::TemporaryToken>
5059
ParseAuthorizedUserRefreshResponse(
5160
storage::internal::HttpResponse const& response,
5261
std::chrono::system_clock::time_point now);
5362

54-
/// Parses a user credentials JSON string into an AuthorizedUserCredentialsInfo.
63+
/**
64+
* Parses a user credentials JSON string into an AuthorizedUserCredentialsInfo.
65+
*
66+
* @deprecated Prefer using the unified credentials documented in @ref guac
67+
*/
5568
StatusOr<AuthorizedUserCredentialsInfo> ParseAuthorizedUserCredentials(
5669
std::string const& content, std::string const& source,
5770
std::string const& default_token_uri =
@@ -78,6 +91,8 @@ StatusOr<AuthorizedUserCredentialsInfo> ParseAuthorizedUserCredentials(
7891
* overridden except for testing.
7992
* @tparam ClockType a dependency injection point to fetch the current time.
8093
* This should generally not be overridden except for testing.
94+
*
95+
* @deprecated Prefer using the unified credentials documented in @ref guac
8196
*/
8297
template <typename HttpRequestBuilderType =
8398
storage::internal::CurlRequestBuilder,

‎google/cloud/storage/oauth2/compute_engine_credentials.h

Copy file name to clipboardExpand all lines: google/cloud/storage/oauth2/compute_engine_credentials.h
+20-4Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,32 @@ namespace cloud {
3636
namespace storage {
3737
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
3838
namespace oauth2 {
39-
/// A helper struct that contains service account metadata.
39+
40+
/**
41+
* A helper struct that contains service account metadata.
42+
*
43+
* @deprecated Prefer using the unified credentials documented in @ref guac
44+
*/
4045
struct ServiceAccountMetadata {
4146
std::set<std::string> scopes;
4247
std::string email;
4348
};
4449

45-
/// Parses a metadata server response JSON string into a ServiceAccountMetadata.
50+
/**
51+
* Parses a metadata server response JSON string into a ServiceAccountMetadata.
52+
*
53+
* @deprecated Prefer using the unified credentials documented in @ref guac
54+
*/
4655
StatusOr<ServiceAccountMetadata> ParseMetadataServerResponse(
4756
storage::internal::HttpResponse const& response);
4857

49-
/// Parses a refresh response JSON string into an authorization header. The
50-
/// header and the current time (for the expiration) form a TemporaryToken.
58+
/**
59+
* Parses a refresh response JSON string into an authorization header.
60+
*
61+
* The header and the current time (for the expiration) form a TemporaryToken.
62+
*
63+
* @deprecated Prefer using the unified credentials documented in @ref guac
64+
*/
5165
StatusOr<RefreshingCredentialsWrapper::TemporaryToken>
5266
ParseComputeEngineRefreshResponse(
5367
storage::internal::HttpResponse const& response,
@@ -75,6 +89,8 @@ ParseComputeEngineRefreshResponse(
7589
* be overridden except for testing.
7690
* @tparam ClockType a dependency injection point to fetch the current time.
7791
* This should generally not be overridden except for testing.
92+
*
93+
* @deprecated Prefer using the unified credentials documented in @ref guac
7894
*/
7995
template <typename HttpRequestBuilderType =
8096
storage::internal::CurlRequestBuilder,

‎google/cloud/storage/oauth2/credential_constants.h

Copy file name to clipboardExpand all lines: google/cloud/storage/oauth2/credential_constants.h
+20-3Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,17 @@ namespace oauth2 {
2929
*
3030
* We currently only support RSA with SHA-256, but use this enum for
3131
* readability and easy addition of support for other algorithms.
32+
*
33+
* @deprecated Prefer using the unified credentials documented in @ref guac
3234
*/
3335
// NOLINTNEXTLINE(readability-identifier-naming)
3436
enum class JwtSigningAlgorithms { RS256 };
3537

36-
/// The max lifetime in seconds of an access token.
38+
/**
39+
* The max lifetime in seconds of an access token.
40+
*
41+
* @deprecated Prefer using the unified credentials documented in @ref guac
42+
*/
3743
constexpr std::chrono::seconds GoogleOAuthAccessTokenLifetime() {
3844
return std::chrono::seconds(3600);
3945
}
@@ -46,23 +52,34 @@ constexpr std::chrono::seconds GoogleOAuthAccessTokenLifetime() {
4652
* check expiration time one second before the expiration, see that the token is
4753
* still valid, then attempt to use it two seconds later and receive an
4854
* error.
55+
*
56+
* @deprecated Prefer using the unified credentials documented in @ref guac
4957
*/
5058
constexpr std::chrono::seconds GoogleOAuthAccessTokenExpirationSlack() {
5159
return std::chrono::seconds(300);
5260
}
5361

54-
/// The endpoint to fetch an OAuth 2.0 access token from.
62+
/**
63+
* The endpoint to fetch an OAuth 2.0 access token from.
64+
*
65+
* @deprecated Prefer using the unified credentials documented in @ref guac
66+
*/
5567
inline char const* GoogleOAuthRefreshEndpoint() {
5668
static constexpr char kEndpoint[] = "https://oauth2.googleapis.com/token";
5769
return kEndpoint;
5870
}
5971

60-
/// String representing the "cloud-platform" OAuth 2.0 scope.
72+
/**
73+
* String representing the "cloud-platform" OAuth 2.0 scope.
74+
*
75+
* @deprecated Prefer using the unified credentials documented in @ref guac
76+
*/
6177
inline char const* GoogleOAuthScopeCloudPlatform() {
6278
static constexpr char kScope[] =
6379
"https://www.googleapis.com/auth/cloud-platform";
6480
return kScope;
6581
}
82+
6683
} // namespace oauth2
6784
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
6885
} // namespace storage

‎google/cloud/storage/oauth2/credentials.h

Copy file name to clipboardExpand all lines: google/cloud/storage/oauth2/credentials.h
+22-2Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,13 @@ namespace google {
2626
namespace cloud {
2727
namespace storage {
2828
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
29+
/**
30+
* Authentication components for Google Cloud Storage.
31+
*
32+
* @deprecated Prefer using the unified credentials documented in @ref guac
33+
*/
2934
namespace oauth2 {
35+
3036
/**
3137
* Interface for OAuth 2.0 credentials used to access Google Cloud services.
3238
*
@@ -35,6 +41,8 @@ namespace oauth2 {
3541
*
3642
* @see https://cloud.google.com/docs/authentication/ for an overview of
3743
* authenticating to Google Cloud Platform APIs.
44+
*
45+
* @deprecated Prefer using the unified credentials documented in @ref guac
3846
*/
3947
class Credentials {
4048
public:
@@ -48,6 +56,8 @@ class Credentials {
4856
* underlying `Status` will indicate failure details from the refresh HTTP
4957
* request. Otherwise, the returned value will contain the Authorization
5058
* header to be used in HTTP requests.
59+
*
60+
* @deprecated Prefer using the unified credentials documented in @ref guac
5161
*/
5262
virtual StatusOr<std::string> AuthorizationHeader() = 0;
5363

@@ -58,15 +68,25 @@ class Credentials {
5868
* of an specific service account. This function returns an error if the
5969
* credentials cannot sign the blob at all, or if the service account is a
6070
* mismatch.
71+
*
72+
* @deprecated Prefer using the unified credentials documented in @ref guac
6173
*/
6274
virtual StatusOr<std::vector<std::uint8_t>> SignBlob(
6375
SigningAccount const& service_account,
6476
std::string const& string_to_sign) const;
6577

66-
/// Return the account's email associated with these credentials, if any.
78+
/**
79+
* Return the account's email associated with these credentials, if any.
80+
*
81+
* @deprecated Prefer using the unified credentials documented in @ref guac
82+
*/
6783
virtual std::string AccountEmail() const { return std::string{}; }
6884

69-
/// Return the account's key_id associated with these credentials, if any.
85+
/**
86+
* Return the account's key_id associated with these credentials, if any.
87+
*
88+
* @deprecated Prefer using the unified credentials documented in @ref guac
89+
*/
7090
virtual std::string KeyId() const { return std::string{}; }
7191
};
7292

‎google/cloud/storage/oauth2/google_application_default_credentials_file.h

Copy file name to clipboardExpand all lines: google/cloud/storage/oauth2/google_application_default_credentials_file.h
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ namespace oauth2 {
2929
*
3030
* This environment variable should be checked for a valid file path when
3131
* attempting to load Google Application Default %Credentials.
32+
*
33+
* @deprecated Prefer using the unified credentials documented in @ref guac
3234
*/
3335
char const* GoogleAdcEnvVar();
3436

@@ -38,6 +40,8 @@ char const* GoogleAdcEnvVar();
3840
* If the Application Default %Credentials environment variable is set, we check
3941
* the path specified by its value for a file containing ADCs. Returns an
4042
* empty string if no such path exists or the environment variable is not set.
43+
*
44+
* @deprecated Prefer using the unified credentials documented in @ref guac
4145
*/
4246
std::string GoogleAdcFilePathFromEnvVarOrEmpty();
4347

@@ -47,6 +51,8 @@ std::string GoogleAdcFilePathFromEnvVarOrEmpty();
4751
* If the gcloud utility has configured an Application Default %Credentials
4852
* file, the path to that file is returned. Returns an empty string if no such
4953
* file exists at the well known path.
54+
*
55+
* @deprecated Prefer using the unified credentials documented in @ref guac
5056
*/
5157
std::string GoogleAdcFilePathFromWellKnownPathOrEmpty();
5258

@@ -55,6 +61,8 @@ std::string GoogleAdcFilePathFromWellKnownPathOrEmpty();
5561
*
5662
* This environment variable is used for testing to override the path that
5763
* should be searched for the gcloud Application Default %Credentials file.
64+
*
65+
* @deprecated Prefer using the unified credentials documented in @ref guac
5866
*/
5967
char const* GoogleGcloudAdcFileEnvVar();
6068

@@ -65,6 +73,8 @@ char const* GoogleGcloudAdcFileEnvVar();
6573
* by this environment variable, varies across environments. That directory is
6674
* used when constructing the well known path of the Application Default
6775
* Credentials file.
76+
*
77+
* @deprecated Prefer using the unified credentials documented in @ref guac
6878
*/
6979
char const* GoogleAdcHomeEnvVar();
7080

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.