From 6c163ac0c7e64711044206dae1b7d6dc0fedecb8 Mon Sep 17 00:00:00 2001 From: Lawrence Qiu Date: Sun, 22 Nov 2026 21:00:23 +0000 Subject: [PATCH] docs(auth): fix invalid Javadoc tags, raw backticks, broken links, and dropped comments --- .../google/auth/CredentialTypeForMetrics.java | 2 - .../auth/oauth2/AwsCredentialSource.java | 17 +++---- .../google/auth/oauth2/AwsCredentials.java | 4 +- .../AwsSecurityCredentialsSupplier.java | 4 +- .../auth/oauth2/ComputeEngineCredentials.java | 12 ++--- .../auth/oauth2/ExecutableResponse.java | 6 +-- ...ernalAccountAuthorizedUserCredentials.java | 8 ++-- .../oauth2/ExternalAccountCredentials.java | 12 ++--- .../google/auth/oauth2/GdchCredentials.java | 19 ++++---- .../google/auth/oauth2/GoogleCredentials.java | 48 ++++++++++--------- .../google/auth/oauth2/IdTokenProvider.java | 6 +-- .../oauth2/IdentityPoolCredentialSource.java | 15 +++--- .../IdentityPoolSubjectTokenSupplier.java | 6 +-- .../auth/oauth2/ImpersonatedCredentials.java | 25 +++++----- .../auth/oauth2/PluggableAuthCredentials.java | 4 +- .../auth/oauth2/SecureSessionAgent.java | 10 ++-- .../oauth2/ServiceAccountCredentials.java | 10 ++-- .../ServiceAccountJwtAccessCredentials.java | 3 +- 18 files changed, 109 insertions(+), 102 deletions(-) diff --git a/google-auth-library-java/credentials/java/com/google/auth/CredentialTypeForMetrics.java b/google-auth-library-java/credentials/java/com/google/auth/CredentialTypeForMetrics.java index ece1ed6f1d05..5d3116bef621 100644 --- a/google-auth-library-java/credentials/java/com/google/auth/CredentialTypeForMetrics.java +++ b/google-auth-library-java/credentials/java/com/google/auth/CredentialTypeForMetrics.java @@ -42,8 +42,6 @@ *

Credentials with type {@code CredentialTypeForMetrics.DO_NOT_SEND} is default value for * credential implementations that do not set type specifically. It is not expected to send metrics. * - *

- * * @see #getLabel() */ @NullMarked diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/AwsCredentialSource.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/AwsCredentialSource.java index 2f307e3ec277..d2c88f377502 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/AwsCredentialSource.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/AwsCredentialSource.java @@ -50,18 +50,19 @@ public class AwsCredentialSource extends ExternalAccountCredentials.CredentialSo final @Nullable String imdsv2SessionTokenUrl; /** - * The source of the AWS credential. The credential source map must contain the - * `regional_cred_verification_url` field. + * The source of the AWS credential. The credential source map must contain the {@code + * regional_cred_verification_url} and {@code environment_id} fields. * - *

The `regional_cred_verification_url` is the regional GetCallerIdentity action URL, used to - * determine the account ID and its roles. + *

The {@code regional_cred_verification_url} is the regional GetCallerIdentity action URL, + * used to determine the account ID and its roles. * - *

The `environment_id` is the environment identifier, in the format “aws${version}”. This - * indicates whether breaking changes were introduced to the underlying AWS implementation. + *

The {@code environment_id} is the environment identifier, in the format {@code + * aws${version}}. This indicates whether breaking changes were introduced to the underlying AWS + * implementation. * - *

The `region_url` identifies the targeted region. Optional. + *

The {@code region_url} identifies the targeted region. Optional. * - *

The `url` locates the metadata server used to retrieve the AWS credentials. Optional. + *

The {@code url} locates the metadata server used to retrieve the AWS credentials. Optional. */ public AwsCredentialSource(Map credentialSourceMap) { super(credentialSourceMap); diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/AwsCredentials.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/AwsCredentials.java index 1dd45c2790c6..5c6ff9a02cc3 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/AwsCredentials.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/AwsCredentials.java @@ -279,8 +279,8 @@ public Builder setAwsSecurityCredentialsSupplier( /** * Sets the AWS regional credential verification URL. If set, will override any credential * verification URL provided in the credential source. If not set, the credential verification - * URL will default to - * `https://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15` + * URL will default to {@code + * https://sts.{region}.amazonaws.com?Action=GetCallerIdentity&Version=2011-06-15} * * @param regionalCredentialVerificationUrlOverride the AWS credential verification url to set. * @return this {@code Builder} object diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/AwsSecurityCredentialsSupplier.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/AwsSecurityCredentialsSupplier.java index 994719119d64..683b7921df57 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/AwsSecurityCredentialsSupplier.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/AwsSecurityCredentialsSupplier.java @@ -47,7 +47,7 @@ public interface AwsSecurityCredentialsSupplier extends Serializable { * * @param context relevant context from the calling credential. * @return the AWS region that should be used for the credential. - * @throws IOException + * @throws IOException if retrieving the AWS region fails. */ String getRegion(ExternalAccountSupplierContext context) throws IOException; @@ -56,7 +56,7 @@ public interface AwsSecurityCredentialsSupplier extends Serializable { * * @param context relevant context from the calling credential. * @return valid AWS security credentials that can be exchanged for a GCP access token. - * @throws IOException + * @throws IOException if retrieving the AWS security credentials fails. */ AwsSecurityCredentials getCredentials(ExternalAccountSupplierContext context) throws IOException; } 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..af47fcb76f24 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 @@ -495,13 +495,13 @@ public AccessToken refreshAccessToken() throws IOException { * * @param targetAudience the aud: field the IdToken should include * @param options list of Credential specific options for the token. For example, an IDToken for a - * ComputeEngineCredential could have the full formatted claims returned if - * IdTokenProvider.Option.FORMAT_FULL) is provided as a list option. Valid option values are: + * {@link ComputeEngineCredentials} could have the full formatted claims returned if {@link + * IdTokenProvider.Option#FORMAT_FULL} is provided as a list option. Valid option values are: *
- * IdTokenProvider.Option.FORMAT_FULL
- * IdTokenProvider.Option.LICENSES_TRUE
- * IdTokenProvider.Option.DISABLE_BOUND_ID_TOKEN (request an ID token that is not bound to the - * agent identity certificate)
+ * {@link IdTokenProvider.Option#FORMAT_FULL}
+ * {@link IdTokenProvider.Option#LICENSES_TRUE}
+ * {@link IdTokenProvider.Option#DISABLE_BOUND_ID_TOKEN} (request an ID token that is not + * bound to the agent identity certificate)
* If no options are set, the defaults are "&format=standard&licenses=false" * @throws IOException if the attempt to get an IdToken failed * @return IdToken object which includes the raw id_token, JsonWebSignature diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ExecutableResponse.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ExecutableResponse.java index 1e8fa837ce2e..e40f4cb73fc6 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ExecutableResponse.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ExecutableResponse.java @@ -109,8 +109,8 @@ class ExecutableResponse { } /** - * Returns the version of the executable output. Only version `1` is currently supported. This is - * useful for future changes to the expected output format. + * Returns the version of the executable output. Only version {@code 1} is currently supported. + * This is useful for future changes to the expected output format. * * @return The version of the JSON output. */ @@ -125,7 +125,7 @@ int getVersion() { * operation. When this is false, the response should contain an additional error code and * message. * - * @return Whether the `success` field in the executable response is true. + * @return Whether the {@code success} field in the executable response is true. */ boolean isSuccessful() { return this.success; diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ExternalAccountAuthorizedUserCredentials.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ExternalAccountAuthorizedUserCredentials.java index 76aedff1fcd7..e96eee73f40b 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ExternalAccountAuthorizedUserCredentials.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ExternalAccountAuthorizedUserCredentials.java @@ -134,8 +134,8 @@ private ExternalAccountAuthorizedUserCredentials(Builder builder) { * external source for authentication to Google Cloud Platform, you must validate it before * providing it to any Google API or library. Providing an unvalidated credential configuration to * Google APIs can compromise the security of your systems and data. For more information, refer - * to {@see documentation}. + * to documentation. * * @param credentialsStream the stream with the credential definition * @return the credential defined by the credentialsStream @@ -153,8 +153,8 @@ public static ExternalAccountAuthorizedUserCredentials fromStream(InputStream cr * external source for authentication to Google Cloud Platform, you must validate it before * providing it to any Google API or library. Providing an unvalidated credential configuration to * Google APIs can compromise the security of your systems and data. For more information, refer - * to {@see documentation}. + * to documentation. * * @param credentialsStream the stream with the credential definition * @param transportFactory the HTTP transport factory used to create the transport to get access diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ExternalAccountCredentials.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ExternalAccountCredentials.java index de329a4e0e7f..c56fdb3fd60b 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ExternalAccountCredentials.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ExternalAccountCredentials.java @@ -365,8 +365,8 @@ public Map> getRequestMetadata(@Nullable URI uri) throws IO * external source for authentication to Google Cloud Platform, you must validate it before * providing it to any Google API or library. Providing an unvalidated credential configuration to * Google APIs can compromise the security of your systems and data. For more information, refer - * to {@see documentation}. + * to documentation. * * @param credentialsStream the stream with the credential definition * @return the credential defined by the credentialsStream @@ -386,8 +386,8 @@ public static ExternalAccountCredentials fromStream(InputStream credentialsStrea * external source for authentication to Google Cloud Platform, you must validate it before * providing it to any Google API or library. Providing an unvalidated credential configuration to * Google APIs can compromise the security of your systems and data. For more information, refer - * to {@see documentation}. + * to documentation. * * @param credentialsStream the stream with the credential definition * @param transportFactory the HTTP transport factory used to create the transport to get access @@ -422,8 +422,8 @@ public static ExternalAccountCredentials fromStream( * external source for authentication to Google Cloud Platform, you must validate it before * providing it to any Google API or library. Providing an unvalidated credential configuration to * Google APIs can compromise the security of your systems and data. For more information, refer - * to {@link documentation}. + * to documentation. * * @param json a map from the JSON representing the credentials * @param transportFactory HTTP transport factory, creates the transport used to get access tokens 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..5b9cd703fa17 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 @@ -144,8 +144,8 @@ public class GdchCredentials extends GoogleCredentials { * external source for authentication to Google Cloud Platform, you must validate it before * providing it to any Google API or library. Providing an unvalidated credential configuration to * Google APIs can compromise the security of your systems and data. For more information, refer - * to {@see documentation}. + * to documentation. * * @param credentialsStream the stream with the credential definition. * @return the credential defined by the credentialsStream. @@ -163,8 +163,8 @@ public static GdchCredentials fromStream(InputStream credentialsStream) throws I * external source for authentication to Google Cloud Platform, you must validate it before * providing it to any Google API or library. Providing an unvalidated credential configuration to * Google APIs can compromise the security of your systems and data. For more information, refer - * to {@see documentation}. + * to documentation. * * @param credentialsStream the stream with the credential definition. * @param transportFactory HTTP transport factory, creates the transport used to get access @@ -285,7 +285,7 @@ static GdchCredentials fromPem(String privateKeyPem, GdchCredentials.Builder bui } /** - * This method is obsolete. Please use {@link #createWithGdchAudience(String)}} instead. Create a + * This method is obsolete. Please use {@link #createWithGdchAudience(String)} instead. Create a * copy of GDCH credentials with the specified audience. * * @param apiAudience The intended audience for GDCH credentials. @@ -377,8 +377,9 @@ public AccessToken refreshAccessToken() throws IOException { * Create a self-signed JWT for GDCH authentication flow. * *

The self-signed JWT is used to exchange access token from GDCH authentication - * (tokenServerUri), not for API call. It uses the serviceIdentityName as the `iss` and `sub` - * claim, and the tokenServerUri as the `aud` claim. The JWT is signed with the privateKey. + * (tokenServerUri), not for API call. It uses {@link #getIssuerSubjectValue(String, String)} as + * the {@code iss} and {@code sub} claims, and the tokenServerUri as the {@code aud} claim. The + * JWT is signed with the privateKey. */ String createAssertion(JsonFactory jsonFactory, long currentTime) throws IOException { JsonWebSignature.Header header = new JsonWebSignature.Header(); @@ -407,8 +408,8 @@ String createAssertion(JsonFactory jsonFactory, long currentTime) throws IOExcep /** * Get the issuer and subject value in the format GDCH token server required. * - *

This value is specific to GDCH and combined parameter used for both `iss` and `sub` fields - * in JWT claim. + *

This value is specific to GDCH and combined parameter used for both {@code iss} and {@code + * sub} fields in JWT claim. */ @VisibleForTesting static String getIssuerSubjectValue(String projectId, String serviceIdentityName) { diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/GoogleCredentials.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/GoogleCredentials.java index 9d41e0811afe..6320f37ea14e 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/GoogleCredentials.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/GoogleCredentials.java @@ -210,11 +210,11 @@ public static GoogleCredentials getApplicationDefault(HttpTransportFactory trans * used without validation on your side. * *

If you know that you will be loading credential configurations of a specific type, it is - * recommended to use a credential-type-specific `fromStream()` method. This will ensure that an - * unexpected credential type with potential for malicious intent is not loaded unintentionally. - * You might still have to do validation for certain credential types. Please follow the - * recommendation for that method. For example, if you want to load only service accounts, you can - * use: + * recommended to use a credential-type-specific {@code fromStream()} method. This will ensure + * that an unexpected credential type with potential for malicious intent is not loaded + * unintentionally. You might still have to do validation for certain credential types. Please + * follow the recommendation for that method. For example, if you want to load only service + * accounts, you can use: * GoogleCredentials credentials = ServiceAccountCredentials.fromStream(json); * . See {@link ServiceAccountCredentials#fromStream(InputStream, HttpTransportFactory)}. * @@ -225,8 +225,8 @@ public static GoogleCredentials getApplicationDefault(HttpTransportFactory trans *

Regardless of the method used, it is always your responsibility to validate configurations * received from external sources. * - *

See the {@see documentation} + *

See the documentation * for more details. * *

Returns credentials defined by a JSON file stream. @@ -277,11 +277,11 @@ static String extractFromJson(Map json, String field) throws IOE * used without validation on your side. * *

If you know that you will be loading credential configurations of a specific type, it is - * recommended to use a credential-type-specific `fromStream()` method. This will ensure that an - * unexpected credential type with potential for malicious intent is not loaded unintentionally. - * You might still have to do validation for certain credential types. Please follow the - * recommendation for that method. For example, if you want to load only service accounts, you can - * use: + * recommended to use a credential-type-specific {@code fromStream()} method. This will ensure + * that an unexpected credential type with potential for malicious intent is not loaded + * unintentionally. You might still have to do validation for certain credential types. Please + * follow the recommendation for that method. For example, if you want to load only service + * accounts, you can use: * GoogleCredentials credentials = ServiceAccountCredentials.fromStream(json); * . See {@link ServiceAccountCredentials#fromStream(InputStream, HttpTransportFactory)}. * @@ -292,8 +292,8 @@ static String extractFromJson(Map json, String field) throws IOE *

Regardless of the method used, it is always your responsibility to validate configurations * received from external sources. * - *

See the {@see documentation} + *

See the documentation * for more details. * *

Returns credentials defined by a JSON file stream. @@ -302,6 +302,8 @@ static String extractFromJson(Map json, String field) throws IOE * Console or a stored user credential using the format supported by the Cloud SDK. * * @param credentialsStream the stream with the credential definition. + * @param transportFactory HTTP transport factory, creates the transport used to get access + * tokens. * @return the credential defined by the credentialsStream. * @throws IOException if the credential cannot be created from the stream. */ @@ -494,6 +496,8 @@ protected GoogleCredentials(Builder builder) { * {@link Builder#setUniverseDomain(String)}) to specify the universe domain explicitly. * * @param accessToken initial or temporary access token + * @param refreshMargin margin before expiration to trigger an asynchronous refresh + * @param expirationMargin margin before expiration to treat the token as expired * @deprecated Use {@link #GoogleCredentials(Builder)} for subclasses, or {@link #newBuilder()} * with {@link Builder#setAccessToken(AccessToken)} and {@link * Builder#setUniverseDomain(String)} for a non-default universe domain. @@ -655,14 +659,14 @@ GoogleCredentials withSource(String source) { *

  • principal - Identity used for the credential * * - * Unknown field values (i.e. null) are not included in the mapping (e.g. ComputeCredentials may - * not know the principal value until after a call to MDS is made and the field will be excluded - * if `getCredentialInfo` is called prior to retrieving that value). A new map of the fields is - * created on every time this method is called as fields may be updated throughout the Credential - * lifecycle. This mapping is intended to provide information about the Credential that is created - * via ADC. Some fields may not be known if a Credential is directly created (e.g. - * `ServiceAccountCredential.fromStream(InputStream)` may not know the source of the file stream). - * These fields are populated on a best effort basis. + * Unknown field values (i.e. null) are not included in the mapping (e.g. {@link + * ComputeEngineCredentials} may not know the principal value until after a call to MDS is made + * and the field will be excluded if {@link #getCredentialInfo()} is called prior to retrieving + * that value). A new map of the fields is created every time this method is called as fields may + * be updated throughout the Credential lifecycle. This mapping is intended to provide information + * about the Credential that is created via ADC. Some fields may not be known if a Credential is + * directly created (e.g. {@link ServiceAccountCredentials#fromStream(InputStream)} may not know + * the source of the file stream). These fields are populated on a best effort basis. * * @return ImmutableMap of information regarding how the Credential was initialized */ diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/IdTokenProvider.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/IdTokenProvider.java index e1673f19d3da..40601a4747de 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/IdTokenProvider.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/IdTokenProvider.java @@ -100,9 +100,9 @@ public String getOption() { * * @param targetAudience List of audiences the issued ID Token should be valid for. targetAudience * accepts a single string value (multiple audiences are not supported) - * @param options List of Credential specific options for for the token. For example, an IDToken - * for a ComputeEngineCredential can return platform specific claims if - * "ComputeEngineCredentials.ID_TOKEN_FORMAT_FULL" is provided as a list option. + * @param options List of Credential specific options for the token. For example, an IDToken for a + * {@link ComputeEngineCredentials} can return platform specific claims if {@link + * IdTokenProvider.Option#FORMAT_FULL} is provided as a list option. * @throws IOException if token creation fails * @return IdToken object which includes the raw id_token, expiration and audience. */ diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/IdentityPoolCredentialSource.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/IdentityPoolCredentialSource.java index 7e0d65b12ec1..1d26c1da444c 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/IdentityPoolCredentialSource.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/IdentityPoolCredentialSource.java @@ -241,17 +241,18 @@ public boolean useDefaultCertificateConfig() { * The source of the 3P credential. * *

    If this is a file based 3P credential, the credentials file can be retrieved using the - * `file` key. + * {@code file} key. * - *

    If this is URL-based 3p credential, the metadata server URL can be retrieved using the `url` - * key. + *

    If this is URL-based 3p credential, the metadata server URL can be retrieved using the + * {@code url} key. * *

    The third party credential can be provided in different formats, such as text or JSON. The - * format can be specified using the `format` header, which returns a map with keys `type` and - * `subject_token_field_name`. If the `type` is json, the `subject_token_field_name` must be - * provided. If no format is provided, we expect the token to be in the raw text format. + * format can be specified using the {@code format} field, which returns a map with keys {@code + * type} and {@code subject_token_field_name}. If the {@code type} is json, the {@code + * subject_token_field_name} must be provided. If no format is provided, we expect the token to be + * in the raw text format. * - *

    Optional headers can be present, and should be keyed by `headers`. + *

    Optional headers can be present, and should be keyed by {@code headers}. */ @SuppressWarnings("unchecked") public IdentityPoolCredentialSource(Map credentialSourceMap) { diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/IdentityPoolSubjectTokenSupplier.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/IdentityPoolSubjectTokenSupplier.java index c518797d8b2a..31906d5a0fe1 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/IdentityPoolSubjectTokenSupplier.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/IdentityPoolSubjectTokenSupplier.java @@ -35,11 +35,11 @@ import java.io.Serializable; import org.jspecify.annotations.NullMarked; -@FunctionalInterface /** - * Provider for retrieving the subject tokens for {@Link IdentityPoolCredentials} to exchange for + * Provider for retrieving the subject tokens for {@link IdentityPoolCredentials} to exchange for * GCP access tokens. */ +@FunctionalInterface @NullMarked public interface IdentityPoolSubjectTokenSupplier extends Serializable { @@ -48,7 +48,7 @@ public interface IdentityPoolSubjectTokenSupplier extends Serializable { * * @param context relevant context from the calling credential. * @return a valid subject token. - * @throws IOException + * @throws IOException if retrieving the subject token fails. */ String getSubjectToken(ExternalAccountSupplierContext context) throws IOException; } 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..341640d47d7c 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 @@ -432,8 +432,8 @@ private String getIamEndpoint(String endpointFormat, String action) throws IOExc * external source for authentication to Google Cloud Platform, you must validate it before * providing it to any Google API or library. Providing an unvalidated credential configuration to * Google APIs can compromise the security of your systems and data. For more information, refer - * to {@see documentation}. + * to documentation. * * @param credentialsStream the stream with the credential definition. * @return the credential defined by the credentialsStream. @@ -452,8 +452,8 @@ public static ImpersonatedCredentials fromStream(InputStream credentialsStream) * external source for authentication to Google Cloud Platform, you must validate it before * providing it to any Google API or library. Providing an unvalidated credential configuration to * Google APIs can compromise the security of your systems and data. For more information, refer - * to {@see documentation}. + * to documentation. * * @param credentialsStream the stream with the credential definition. * @param transportFactory HTTP transport factory, creates the transport used to get access @@ -486,8 +486,8 @@ public static ImpersonatedCredentials fromStream( * external source for authentication to Google Cloud Platform, you must validate it before * providing it to any Google API or library. Providing an unvalidated credential configuration to * Google APIs can compromise the security of your systems and data. For more information, refer - * to {@link documentation}. + * to documentation. * * @param json a map from the JSON representing the credentials * @param transportFactory HTTP transport factory, creates the transport used to get access tokens @@ -1002,10 +1002,10 @@ public AccessToken refreshAccessToken() { * * @param targetAudience the audience field for the issued ID token * @param options credential specific options for the token. For example, an ID token for an - * ImpersonatedCredentials can return the email address within the token claims if - * "ImpersonatedCredentials.INCLUDE_EMAIL" is provided as a list option.
    - * Only one option value is supported: "ImpersonatedCredentials.INCLUDE_EMAIL" If no options - * are set, the default excludes the "includeEmail" attribute in the API request. + * ImpersonatedCredentials can return the email address within the token claims if {@link + * IdTokenProvider.Option#INCLUDE_EMAIL} is provided as a list option.
    + * Only one option value is supported: {@link IdTokenProvider.Option#INCLUDE_EMAIL}. If no + * options are set, the default excludes the "includeEmail" attribute in the API request. * @return IdToken object which includes the raw id_token, expiration, and audience * @throws IOException if the attempt to get an ID token failed */ @@ -1112,8 +1112,9 @@ protected Builder() {} /** * @param sourceCredentials The source credentials to use for impersonation. * @param targetPrincipal The service account to impersonate. - * @deprecated Use {@link #Builder(ImpersonatedCredentials)} instead. This constructor will be - * removed in a future release. + * @deprecated Use {@link ImpersonatedCredentials#newBuilder()} or {@link + * ImpersonatedCredentials#toBuilder()} instead. This constructor will be removed in a + * future release. */ @Deprecated protected Builder(GoogleCredentials sourceCredentials, String targetPrincipal) { 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..b6e9f36140fc 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 @@ -88,8 +88,8 @@ * } * * - *

    The `expiration_time` field in the JSON response is only required for successful responses - * when an output file was specified in the credential configuration. + *

    The {@code expiration_time} field in the JSON response is only required for successful + * responses when an output file was specified in the credential configuration. * *

    The auth libraries will populate certain environment variables that will be accessible by the * executable, such as: GOOGLE_EXTERNAL_ACCOUNT_AUDIENCE, GOOGLE_EXTERNAL_ACCOUNT_TOKEN_TYPE, diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/SecureSessionAgent.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/SecureSessionAgent.java index f75d23430de5..1c75098fa53b 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/SecureSessionAgent.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/SecureSessionAgent.java @@ -132,11 +132,11 @@ public SecureSessionAgent build() { * populated with empty addresses. * *

    Users are expected to try to fetch the mTLS-S2A address first (via {@link - * getMtlsS2AAddress}). If it is empty or they have some problem loading the mTLS-MDS credentials, - * they should then fallback to fetching the plaintext-S2A address (via {@link - * getPlaintextS2AAddress}). If the plaintext-S2A address is empty it means that an error occurred - * when talking to the MDS / processing the response or that S2A is not running in the - * environment; in either case this indicates S2A shouldn't be used. + * SecureSessionAgentConfig#getMtlsAddress()}). If it is empty or they have some problem loading + * the mTLS-MDS credentials, they should then fallback to fetching the plaintext-S2A address (via + * {@link SecureSessionAgentConfig#getPlaintextAddress()}). If the plaintext-S2A address is empty + * it means that an error occurred when talking to the MDS / processing the response or that S2A + * is not running in the environment; in either case this indicates S2A shouldn't be used. * * @return the {@link SecureSessionAgentConfig}. */ diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java index 76a66d05b46d..f9f6fa4d4ed2 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java @@ -461,8 +461,8 @@ static ServiceAccountCredentials fromPkcs8( * external source for authentication to Google Cloud Platform, you must validate it before * providing it to any Google API or library. Providing an unvalidated credential configuration to * Google APIs can compromise the security of your systems and data. For more information, refer - * to {@see documentation}. + * to documentation. * * @param credentialsStream the stream with the credential definition. * @return the credential defined by the credentialsStream. @@ -481,8 +481,8 @@ public static ServiceAccountCredentials fromStream(InputStream credentialsStream * external source for authentication to Google Cloud Platform, you must validate it before * providing it to any Google API or library. Providing an unvalidated credential configuration to * Google APIs can compromise the security of your systems and data. For more information, refer - * to {@see documentation}. + * to documentation. * * @param credentialsStream the stream with the credential definition. * @param transportFactory HTTP transport factory, creates the transport used to get access @@ -674,7 +674,7 @@ private IdToken getIdTokenOauthEndpoint(String targetAudience) throws IOExceptio *

    This flow works as follows: * *

      - *
    1. Create a self-signed jwt with `https://www.googleapis.com/auth/iam` as the scope. + *
    2. Create a self-signed jwt with {@code https://www.googleapis.com/auth/iam} as the scope. *
    3. Use the self-signed jwt as the access token, and make a POST request to IAM * generateIdToken endpoint. *
    4. If the request is successfully, it will return {"token":"the ID token"}. Extract the ID diff --git a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ServiceAccountJwtAccessCredentials.java b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ServiceAccountJwtAccessCredentials.java index f4958c9ef107..93125d976751 100644 --- a/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ServiceAccountJwtAccessCredentials.java +++ b/google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/ServiceAccountJwtAccessCredentials.java @@ -128,6 +128,7 @@ private ServiceAccountJwtAccessCredentials( * @param privateKey RSA private key object for the service account. * @param privateKeyId Private key identifier for the service account. May be null. * @param defaultAudience Audience to use if not provided by transport. May be null. + * @param quotaProjectId Quota project ID for billing and quota purposes. May be null. * @param universeDomain universe domain in the format some-domain.xyz. By default, sets it to * googleapis.com */ @@ -595,8 +596,8 @@ public Builder setQuotaProjectId(String quotaProjectId) { return this; } - @CanIgnoreReturnValue /** Sets the universe domain (example, googleapis.com). */ + @CanIgnoreReturnValue public Builder setUniverseDomain(String universeDomain) { this.universeDomain = universeDomain; return this;