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 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: 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 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: 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 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 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:
*
*
- * 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
+ * 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
*
+ * 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
- * 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 @@
* }
*
*
- *
- *