Skip to content

Commit 91174bd

Browse files
authored
refactor(auth): use @internalapi annotation instead of comments (#13579)
Use the Java SDK `@InternalApi` instead of comments nested in the javadocs. This follows the convention throughout the Java SDK to denote classes that users should not use.
1 parent 6abef19 commit 91174bd

4 files changed

Lines changed: 7 additions & 18 deletions

File tree

google-auth-library-java/oauth2_http/java/com/google/auth/mtls/DefaultMtlsProviderFactory.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@
3030

3131
package com.google.auth.mtls;
3232

33+
import com.google.api.core.InternalApi;
3334
import java.io.IOException;
3435

36+
@InternalApi
3537
public class DefaultMtlsProviderFactory {
3638

3739
/**
@@ -40,9 +42,6 @@ public class DefaultMtlsProviderFactory {
4042
* creating a {@link SecureConnectProvider}. If the secure connect provider also fails, it throws
4143
* a {@link com.google.auth.mtls.CertificateSourceUnavailableException}.
4244
*
43-
* <p>This is only meant to be used internally by Google Cloud libraries, and the public facing
44-
* methods may be changed without notice, and have no guarantee of backwards compatibility.
45-
*
4645
* @return an instance of {@link MtlsProvider}.
4746
* @throws com.google.auth.mtls.CertificateSourceUnavailableException if neither provider can be
4847
* created.

google-auth-library-java/oauth2_http/java/com/google/auth/mtls/SecureConnectProvider.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import com.google.api.client.json.JsonParser;
3434
import com.google.api.client.json.gson.GsonFactory;
3535
import com.google.api.client.util.SecurityUtils;
36+
import com.google.api.core.InternalApi;
3637
import com.google.common.annotations.VisibleForTesting;
3738
import com.google.common.collect.ImmutableList;
3839
import java.io.FileInputStream;
@@ -46,9 +47,7 @@
4647

4748
/**
4849
* This class implements {@link MtlsProvider} for the Google Auth library transport layer via {@link
49-
* ContextAwareMetadataJson}. This is only meant to be used internally by Google Cloud libraries,
50-
* and the public facing methods may be changed without notice, and have no guarantee of backwards
51-
* compatibility.
50+
* ContextAwareMetadataJson}.
5251
*
5352
* <p>Note: This implementation is derived from the existing "MtlsProvider" found in the Gax
5453
* library, with two notable differences: 1) All logic associated with parsing environment variables
@@ -60,6 +59,7 @@
6059
* <p>Additionally, this implementation will replace the existing "MtlsProvider" in the Gax library.
6160
* The Gax library version of MtlsProvider will be marked as deprecated.
6261
*/
62+
@InternalApi
6363
public class SecureConnectProvider implements MtlsProvider {
6464
interface ProcessProvider {
6565
public Process createProcess(InputStream metadata) throws IOException;

google-auth-library-java/oauth2_http/java/com/google/auth/mtls/X509Provider.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@
4545

4646
/**
4747
* This class implements {@link MtlsProvider} for the Google Auth library transport layer via {@link
48-
* WorkloadCertificateConfiguration}. This is only meant to be used internally by Google Cloud
49-
* libraries, and the public facing methods may be changed without notice, and have no guarantee of
50-
* backwards compatibility.
48+
* WorkloadCertificateConfiguration}.
5149
*/
5250
@InternalApi
5351
public class X509Provider implements MtlsProvider {

google-auth-library-java/oauth2_http/java/com/google/auth/oauth2/OAuth2Utils.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,7 @@
6969
import java.util.Map;
7070
import java.util.Set;
7171

72-
/**
73-
* Internal utilities for the com.google.auth.oauth2 namespace.
74-
*
75-
* <p>These classes are marked public but should be treated effectively as internal classes only.
76-
* They are not subject to any backwards compatibility guarantees and might change or be removed at
77-
* any time. They are provided only as a convenience for other libraries within the {@code
78-
* com.google.auth} family. Application developers should avoid using these classes directly; they
79-
* are not part of the public API.
80-
*/
72+
/** Internal utilities for the com.google.auth.oauth2 namespace. */
8173
@InternalApi
8274
public class OAuth2Utils {
8375

0 commit comments

Comments
 (0)