From c4936e4f1935daef09fa8a601778025d8a9d139d Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Sun, 22 Nov 2026 21:00:42 +0000 Subject: [PATCH] docs(auth): remove internal shortlink and update dead or legacy URLs - Remove internal shortlink references in GdchCredentials. - Replace archived standalone repo issue URL in MtlsProvider and dead README pointer in PluggableAuthCredentials. - Upgrade plain http:// links and legacy IAM, RFC, and developer URLs and section anchors to canonical HTTP 200 destinations. --- .../google/auth/http/HttpCredentialsAdapter.java | 10 +++++----- .../java/com/google/auth/mtls/MtlsProvider.java | 6 +++--- .../java/com/google/auth/oauth2/ActingParty.java | 5 +++-- .../auth/oauth2/ComputeEngineCredentials.java | 4 ++-- .../auth/oauth2/CredentialAccessBoundary.java | 9 +++++---- .../auth/oauth2/DefaultCredentialsProvider.java | 4 ++-- .../google/auth/oauth2/DefaultPKCEProvider.java | 7 +++++-- .../auth/oauth2/DownscopedCredentials.java | 5 +++-- .../com/google/auth/oauth2/GdchCredentials.java | 12 +++++------- .../java/com/google/auth/oauth2/IamUtils.java | 5 +++-- .../auth/oauth2/ImpersonatedCredentials.java | 16 +++++++--------- .../com/google/auth/oauth2/OAuthException.java | 4 ++-- .../auth/oauth2/PluggableAuthCredentials.java | 5 ++++- .../google/auth/oauth2/StsRequestHandler.java | 2 +- .../auth/oauth2/StsTokenExchangeRequest.java | 2 +- .../auth/oauth2/StsTokenExchangeResponse.java | 4 ++-- .../com/google/auth/oauth2/UserAuthorizer.java | 3 ++- 17 files changed, 55 insertions(+), 48 deletions(-) diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/http/HttpCredentialsAdapter.java b/google-auth-library-java/oauth2_http/java/com/google/auth/http/HttpCredentialsAdapter.java index 195777642e15..d7ff06af9950 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/http/HttpCredentialsAdapter.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/http/HttpCredentialsAdapter.java @@ -113,11 +113,11 @@ public void initialize(HttpRequest request) throws IOException { * {@inheritDoc} * *

Checks if {@code WWW-Authenticate} exists and contains a "Bearer" value (see rfc6750 section 3.1 for more - * details). If so, it refreshes the token in case the error code contains {@code invalid_token}. - * If there is no "Bearer" in {@code WWW-Authenticate} and the status code is {@link - * HttpStatusCodes#STATUS_CODE_UNAUTHORIZED} it refreshes the token. If the token refresh throws - * an I/O exception, this implementation will log the exception and return {@code false}. + * href="https://datatracker.ietf.org/doc/html/rfc6750#section-3.1">RFC 6750 Section 3.1 for + * more details). If so, it refreshes the token in case the error code contains {@code + * invalid_token}. If there is no "Bearer" in {@code WWW-Authenticate} and the status code is + * {@link HttpStatusCodes#STATUS_CODE_UNAUTHORIZED} it refreshes the token. If the token refresh + * throws an I/O exception, this implementation will log the exception and return {@code false}. */ @Override public boolean handleResponse(HttpRequest request, HttpResponse response, boolean supportsRetry) { diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/mtls/MtlsProvider.java b/google-auth-library-java/oauth2_http/java/com/google/auth/mtls/MtlsProvider.java index 0edc8c6cefc2..e83d38eb01cd 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/mtls/MtlsProvider.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/mtls/MtlsProvider.java @@ -38,9 +38,9 @@ * MtlsProvider is used by the Gax library for configuring mutual TLS in the HTTP and GRPC transport * layer. The source of the client certificate is up to the implementation. * - *

Note: This interface will replace the identically named "MtlsProvider" implementation in the - * Gax library. The Gax library version of MtlsProvider will be marked as deprecated. See - * https://github.com/googleapis/google-auth-library-java/issues/1758 + *

Note: This interface replaces the deprecated {@code com.google.api.gax.rpc.mtls.MtlsProvider} + * class in GAX. See AIP-4114 for device certificate + * mutual TLS details. */ @NullMarked public interface MtlsProvider { diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ActingParty.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ActingParty.java index 34aa031a6cd6..cf307df42911 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ActingParty.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ActingParty.java @@ -36,8 +36,9 @@ import org.jspecify.annotations.NullMarked; /** - * The acting party as defined in OAuth 2.0 Token - * Exchange. + * The acting party as defined in OAuth 2.0 Token Exchange (RFC + * 8693, Section 2.1). */ @NullMarked final class ActingParty { diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ComputeEngineCredentials.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ComputeEngineCredentials.java index 40c15fc1fa11..ed2829b97baa 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ComputeEngineCredentials.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ComputeEngineCredentials.java @@ -84,7 +84,7 @@ *

Fetches access tokens from the Google Compute Engine metadata server. When a workload * certificate for an agent identity is available, requests certificate-bound access tokens and ID * tokens by default (see {@code IdTokenProvider.Option.DISABLE_BOUND_ID_TOKEN} and the Google + * href="https://docs.cloud.google.com/java/getting-started/getting-started-with-google-auth-library#certificate-bound-tokens-for-agent-identities">Google * Auth Library guide). * *

These credentials use the IAM API to sign data. See {@link #sign(byte[])} for more details. @@ -879,7 +879,7 @@ public String getAccount() { * @return signed bytes * @throws SigningException if the attempt to sign the provided bytes failed * @see Blob + * href="https://docs.cloud.google.com/iam/docs/reference/credentials/rest/v1/projects.serviceAccounts/signBlob">Blob * Signing */ @Override diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/CredentialAccessBoundary.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/CredentialAccessBoundary.java index 7346c850ce4f..33204568d403 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/CredentialAccessBoundary.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/CredentialAccessBoundary.java @@ -47,8 +47,9 @@ * Defines an upper bound of permissions available for a GCP credential via {@link * AccessBoundaryRule}s. * - *

See for more - * information. + *

See Downscoping + * with Credential Access Boundaries for more information. */ @NullMarked public final class CredentialAccessBoundary implements Serializable { @@ -394,8 +395,8 @@ private Builder() {} * format. * *

This expression specifies the Cloud Storage object where permissions are available. - * See for more - * information. + * See IAM + * Conditions Overview for more information. * * @param expression the expression to set * @return this {@code Builder} object diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/DefaultCredentialsProvider.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/DefaultCredentialsProvider.java index a763326a870c..df5d8946dce5 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/DefaultCredentialsProvider.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/DefaultCredentialsProvider.java @@ -78,12 +78,12 @@ class DefaultCredentialsProvider { "You are authenticating using user credentials. " + "For production, we recommend using service account credentials.\n\n" + "To learn more about service account credentials, see " - + "http://cloud.google.com/docs/authentication/external/set-up-adc-on-cloud"; + + "https://docs.cloud.google.com/docs/authentication/set-up-adc-attached-service-account"; static final String CLOUDSDK_MISSING_CREDENTIALS = "Your default credentials were not found. To set up Application Default Credentials " + "for your environment, see " - + "https://cloud.google.com/docs/authentication/external/set-up-adc."; + + "https://docs.cloud.google.com/docs/authentication/provide-credentials-adc#how-to"; public static final String SUPPRESS_GCLOUD_CREDS_WARNING_ENV_VAR = "SUPPRESS_GCLOUD_CREDS_WARNING"; diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/DefaultPKCEProvider.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/DefaultPKCEProvider.java index dbdf9b2ba172..259de9f4bbfd 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/DefaultPKCEProvider.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/DefaultPKCEProvider.java @@ -38,9 +38,12 @@ import org.jspecify.annotations.NullMarked; /** - * Implements PKCE using only the Java standard library. See https://www.rfc-editor.org/rfc/rfc7636. + * Implements PKCE using only the Java standard library. See RFC 7636. * - *

https://developers.google.com/identity/protocols/oauth2/native-app#step1-code-verifier. + *

See OAuth + * 2.0 for Desktop Apps. */ @NullMarked public class DefaultPKCEProvider implements PKCEProvider { diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/DownscopedCredentials.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/DownscopedCredentials.java index c7a0f4c16a1b..af47a588a39c 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/DownscopedCredentials.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/DownscopedCredentials.java @@ -60,8 +60,9 @@ * the upper bound of permissions that the credential can access. You must also provide a source * credential which will be used to acquire the downscoped credential. * - *

See for more - * information. + *

See Downscoping + * with Credential Access Boundaries for more information. * *

Usage: * diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/GdchCredentials.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/GdchCredentials.java index 19362961ffe9..eda548678f7e 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/GdchCredentials.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/GdchCredentials.java @@ -90,13 +90,11 @@ public class GdchCredentials extends GoogleCredentials { /** * The expected format version for GDCH credential profiles. Version "1" indicates the initial and - * currently supported JSON format for these credentials. See go/gdch-python-auth-lib for more - * info. + * currently supported JSON format for these credentials. */ @VisibleForTesting static final String SUPPORTED_JSON_FORMAT_VERSION = "1"; // Custom URN used by GDCH to identify service account tokens in token exchange requests. - // See go/gdch-python-auth-lib for more information. private static final String SERVICE_ACCOUNT_TOKEN_TYPE = "urn:k8s:params:oauth:token-type:serviceaccount"; @@ -737,14 +735,14 @@ private void setTransport(String caCertPath) throws IOException { * Signs the JWS header and payload using the ES256 algorithm (ECDSA with SHA-256). * *

The ES256 algorithm is defined in RFC 7518 Section 3.4. This method - * follows the JWS Compact Serialization format described in RFC 7515 Section 3.1. + * href="https://datatracker.ietf.org/doc/html/rfc7518#section-3.4">RFC 7518 Section 3.4. This + * method follows the JWS Compact Serialization format described in RFC 7515 Section 3.1. * *

Unlike RSA signatures, ECDSA signatures produced by the Java Cryptography Architecture (JCA) * are DER-encoded. This method transcodes the DER-encoded signature into the concatenated R|S * format required by the JWS standard, as specified in RFC 7515 Appendix A.3. + * href="https://datatracker.ietf.org/doc/html/rfc7515#appendix-A.3">RFC 7515 Appendix A.3. * * @param privateKey The Elliptic Curve private key used for signing. * @param jsonFactory The JSON factory to serialize header and payload. diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/IamUtils.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/IamUtils.java index 342567a030a7..491ceea49c02 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/IamUtils.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/IamUtils.java @@ -91,7 +91,7 @@ class IamUtils { private static final LoggerProvider LOGGER_PROVIDER = LoggerProvider.forClazz(IamUtils.class); // Following guidance for IAM retries: - // https://cloud.google.com/iam/docs/retry-strategy#errors-to-retry + // https://docs.cloud.google.com/iam/docs/retry-strategy#errors-to-retry static final Set IAM_RETRYABLE_STATUS_CODES = new HashSet<>(Arrays.asList(500, 502, 503, 504)); @@ -504,7 +504,8 @@ static IdToken getIdToken( * @return IdToken issed to the serviceAccount * @throws IOException if the IdToken cannot be issued. * @see ... + * href="https://docs.cloud.google.com/iam/docs/reference/credentials/rest/v1/projects.serviceAccounts/generateIdToken">IAM + * Credentials API: generateIdToken */ static IdToken getIdToken( String idTokenUrl, diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ImpersonatedCredentials.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ImpersonatedCredentials.java index 79d7bda717b8..69af7748b432 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ImpersonatedCredentials.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ImpersonatedCredentials.java @@ -147,7 +147,7 @@ public class ImpersonatedCredentials extends GoogleCredentials * @param scopes scopes to request during the authorization grant * @param lifetime number of seconds the delegated credential should be valid. By default this * value should be at most 3600. However, you can follow these + * href="https://docs.cloud.google.com/organization-policy/restrict-service-accounts#extend_oauth_ttl">these * instructions to set up the service account and extend the maximum lifetime to 43200 (12 * hours). If the given lifetime is 0, default value 3600 will be used instead when creating * the credentials. @@ -186,7 +186,7 @@ public static ImpersonatedCredentials create( * @param scopes scopes to request during the authorization grant * @param lifetime number of seconds the delegated credential should be valid. By default this * value should be at most 3600. However, you can follow these + * href="https://docs.cloud.google.com/organization-policy/restrict-service-accounts#extend_oauth_ttl">these * instructions to set up the service account and extend the maximum lifetime to 43200 (12 * hours). If the given lifetime is 0, default value 3600 will be used instead when creating * the credentials. @@ -233,7 +233,7 @@ public static ImpersonatedCredentials create( * @param scopes scopes to request during the authorization grant * @param lifetime number of seconds the delegated credential should be valid. By default this * value should be at most 3600. However, you can follow these + * href="https://docs.cloud.google.com/organization-policy/restrict-service-accounts#extend_oauth_ttl">these * instructions to set up the service account and extend the maximum lifetime to 43200 (12 * hours). If the given lifetime is 0, default value 3600 will be used instead when creating * the credentials. @@ -284,12 +284,10 @@ public static ImpersonatedCredentials create( * @param scopes scopes to request during the authorization grant * @param lifetime number of seconds the delegated credential should be valid. By default this * value should be at most 3600. However, you can follow these + * href="https://docs.cloud.google.com/organization-policy/restrict-service-accounts#extend_oauth_ttl">these * instructions to set up the service account and extend the maximum lifetime to 43200 (12 - * hours). - * https://cloud.google.com/iam/docs/creating-short-lived-service-account-credentials#sa-credentials-oauth - * If the given lifetime is 0, default value 3600 will be used instead when creating the - * credentials. + * hours). If the given lifetime is 0, default value 3600 will be used instead when creating + * the credentials. * @return new credentials */ public static ImpersonatedCredentials create( @@ -364,7 +362,7 @@ public void setTransportFactory(HttpTransportFactory httpTransportFactory) { * @return signed bytes * @throws SigningException if the attempt to sign the provided bytes failed * @see Blob + * href="https://docs.cloud.google.com/iam/docs/reference/credentials/rest/v1/projects.serviceAccounts/signBlob">Blob * Signing */ @Override diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/OAuthException.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/OAuthException.java index 11285e517b07..4e6e1714c91c 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/OAuthException.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/OAuthException.java @@ -41,8 +41,8 @@ import org.jspecify.annotations.Nullable; /** - * Encapsulates the standard OAuth error response. See - * https://tools.ietf.org/html/rfc6749#section-5.2. + * Encapsulates the standard OAuth error response. See RFC 6749 Section 5.2. */ @NullMarked class OAuthException extends GoogleAuthException { diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/PluggableAuthCredentials.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/PluggableAuthCredentials.java index 7b26d8deb0c2..b15ec62fd5b9 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/PluggableAuthCredentials.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/PluggableAuthCredentials.java @@ -96,7 +96,10 @@ * GOOGLE_EXTERNAL_ACCOUNT_INTERACTIVE, GOOGLE_EXTERNAL_ACCOUNT_IMPERSONATED_EMAIL, and * GOOGLE_EXTERNAL_ACCOUNT_OUTPUT_FILE. * - *

Please see this repositories README for a complete executable request/response specification. + *

See Create + * a credential configuration (Executable-sourced credentials) for the complete executable + * request and response specification. */ @NullMarked public class PluggableAuthCredentials extends ExternalAccountCredentials { diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/StsRequestHandler.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/StsRequestHandler.java index b1db8b682b9c..b79c8e30062c 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/StsRequestHandler.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/StsRequestHandler.java @@ -53,7 +53,7 @@ /** * Implements the OAuth 2.0 token exchange based on RFC 8693. + * href="https://datatracker.ietf.org/doc/html/rfc8693">RFC 8693. * *

This class handles the process of exchanging one type of token for another using the Security * Token Service (STS). It constructs and sends the token exchange request to the STS endpoint and diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/StsTokenExchangeRequest.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/StsTokenExchangeRequest.java index 036e28aa0846..57873b767f9a 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/StsTokenExchangeRequest.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/StsTokenExchangeRequest.java @@ -40,7 +40,7 @@ /** * Represents an OAuth 2.0 token exchange request, as defined in RFC 8693, Section 2.1. + * href="https://datatracker.ietf.org/doc/html/rfc8693#section-2.1">RFC 8693, Section 2.1. * *

This class encapsulates the parameters necessary for making a token exchange request to Google * Security Token Service (STS). It includes the subject token, subject token type, optional diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/StsTokenExchangeResponse.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/StsTokenExchangeResponse.java index 51881027906c..dffc04393c46 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/StsTokenExchangeResponse.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/StsTokenExchangeResponse.java @@ -42,8 +42,8 @@ /** * Represents a successful OAuth 2.0 token exchange response from the Google Security Token Service - * (STS), as defined in RFC 8693, - * Section 2.2.1. + * (STS), as defined in RFC + * 8693, Section 2.2.1. * *

This class provides access to the exchanged access token, issued token type, token type, * expiration time, refresh token (optional), scopes (optional), and the access boundary session key diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/UserAuthorizer.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/UserAuthorizer.java index ed22e5e9b25d..391e094100ea 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/UserAuthorizer.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/UserAuthorizer.java @@ -73,7 +73,8 @@ public class UserAuthorizer { /** * Represents the client authentication types as specified in RFC 7591. * - *

For more details, see RFC 7591. + *

For more details, see RFC + * 7591, Section 2. */ public enum ClientAuthenticationType { CLIENT_SECRET_POST,