Skip to content

Commit 7a2b2ce

Browse files
committed
feat(mtls): Update code comments
1 parent 67a93b3 commit 7a2b2ce

File tree

6 files changed

+47
-34
lines changed

6 files changed

+47
-34
lines changed

oauth2_http/java/com/google/auth/mtls/CertificateSourceUnavailableException.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
/*
2-
* Copyright 2025, Google Inc. All rights reserved.
2+
* Copyright 2025 Google LLC
33
*
44
* Redistribution and use in source and binary forms, with or without
55
* modification, are permitted provided that the following conditions are
66
* met:
77
*
8-
* * Redistributions of source code must retain the above copyright
8+
* * Redistributions of source code must retain the above copyright
99
* notice, this list of conditions and the following disclaimer.
10-
* * Redistributions in binary form must reproduce the above
10+
* * Redistributions in binary form must reproduce the above
1111
* copyright notice, this list of conditions and the following disclaimer
1212
* in the documentation and/or other materials provided with the
1313
* distribution.
14-
*
15-
* * Neither the name of Google Inc. nor the names of its
14+
* * Neither the name of Google LLC nor the names of its
1615
* contributors may be used to endorse or promote products derived from
1716
* this software without specific prior written permission.
1817
*

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
/*
2-
* Copyright 2025, Google Inc. All rights reserved.
2+
* Copyright 2025 Google LLC
33
*
44
* Redistribution and use in source and binary forms, with or without
55
* modification, are permitted provided that the following conditions are
66
* met:
77
*
8-
* * Redistributions of source code must retain the above copyright
8+
* * Redistributions of source code must retain the above copyright
99
* notice, this list of conditions and the following disclaimer.
10-
* * Redistributions in binary form must reproduce the above
10+
* * Redistributions in binary form must reproduce the above
1111
* copyright notice, this list of conditions and the following disclaimer
1212
* in the documentation and/or other materials provided with the
1313
* distribution.
14-
*
15-
* * Neither the name of Google Inc. nor the names of its
14+
* * Neither the name of Google LLC nor the names of its
1615
* contributors may be used to endorse or promote products derived from
1716
* this software without specific prior written permission.
1817
*

oauth2_http/java/com/google/auth/mtls/MtlsProvider.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
/*
2-
* Copyright 2025, Google Inc. All rights reserved.
2+
* Copyright 2025 Google LLC
33
*
44
* Redistribution and use in source and binary forms, with or without
55
* modification, are permitted provided that the following conditions are
66
* met:
77
*
8-
* * Redistributions of source code must retain the above copyright
8+
* * Redistributions of source code must retain the above copyright
99
* notice, this list of conditions and the following disclaimer.
10-
* * Redistributions in binary form must reproduce the above
10+
* * Redistributions in binary form must reproduce the above
1111
* copyright notice, this list of conditions and the following disclaimer
1212
* in the documentation and/or other materials provided with the
1313
* distribution.
14-
*
15-
* * Neither the name of Google Inc. nor the names of its
14+
* * Neither the name of Google LLC nor the names of its
1615
* contributors may be used to endorse or promote products derived from
1716
* this software without specific prior written permission.
1817
*
@@ -34,6 +33,13 @@
3433
import java.io.IOException;
3534
import java.security.KeyStore;
3635

36+
/**
37+
* MtlsProvider is used by the Gax library for configuring mutual TLS in the HTTP and GRPC transport
38+
* layer. The source of the client certificate is up to the implementation.
39+
*
40+
* <p>Note: This interface will replace the identically named "MtlsProvider" implementation in the
41+
* Gax library. The Gax library version of MtlsProvider will be marked as deprecated.
42+
*/
3743
public interface MtlsProvider {
3844
/** Returns the mutual TLS key store. */
3945
KeyStore getKeyStore() throws IOException;

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

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
/*
2-
* Copyright 2025, Google Inc. All rights reserved.
2+
* Copyright 2025 Google LLC
33
*
44
* Redistribution and use in source and binary forms, with or without
55
* modification, are permitted provided that the following conditions are
66
* met:
77
*
8-
* * Redistributions of source code must retain the above copyright
8+
* * Redistributions of source code must retain the above copyright
99
* notice, this list of conditions and the following disclaimer.
10-
* * Redistributions in binary form must reproduce the above
10+
* * Redistributions in binary form must reproduce the above
1111
* copyright notice, this list of conditions and the following disclaimer
1212
* in the documentation and/or other materials provided with the
1313
* distribution.
14-
*
15-
* * Neither the name of Google Inc. nor the names of its
14+
* * Neither the name of Google LLC nor the names of its
1615
* contributors may be used to endorse or promote products derived from
1716
* this software without specific prior written permission.
1817
*
@@ -45,8 +44,20 @@
4544
import java.util.List;
4645

4746
/**
48-
* Provider class for mutual TLS. It is used to configure the mutual TLS in the transport with the
49-
* default client certificate on device.
47+
* This class implements {@link MtlsProvider} for the Google Auth library transport layer via {@link
48+
* ContextAwareMetadataJson}. This is only meant to be used internally by Google Cloud libraries,
49+
* and the public facing methods may be changed without notice, and have no guarantee of backwards
50+
* compatability.
51+
*
52+
* <p>Note: This implementation is derived from the existing "MtlsProvider" found in the Gax
53+
* library, with two notable differences: 1) All logic associated with parsing environment variables
54+
* related to "mTLS usage" are omitted - a separate helper class will be introduced in the Gax
55+
* library to serve this purpose. 2) getKeyStore throws {@link
56+
* com.google.auth.mtls.CertificateSourceUnavailableException} instead of returning "null" if this
57+
* cert source is not available on the device.
58+
*
59+
* <p>Additionally, this implementation will replace the existing "MtlsProvider" in the Gax library.
60+
* The Gax library version of MtlsProvider will be marked as deprecated.
5061
*/
5162
public class SecureConnectProvider implements MtlsProvider {
5263
interface ProcessProvider {

oauth2_http/java/com/google/auth/mtls/WorkloadCertificateConfiguration.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
/*
2-
* Copyright 2025, Google Inc. All rights reserved.
2+
* Copyright 2025 Google LLC
33
*
44
* Redistribution and use in source and binary forms, with or without
55
* modification, are permitted provided that the following conditions are
66
* met:
77
*
8-
* * Redistributions of source code must retain the above copyright
8+
* * Redistributions of source code must retain the above copyright
99
* notice, this list of conditions and the following disclaimer.
10-
* * Redistributions in binary form must reproduce the above
10+
* * Redistributions in binary form must reproduce the above
1111
* copyright notice, this list of conditions and the following disclaimer
1212
* in the documentation and/or other materials provided with the
1313
* distribution.
14-
*
15-
* * Neither the name of Google Inc. nor the names of its
14+
* * Neither the name of Google LLC nor the names of its
1615
* contributors may be used to endorse or promote products derived from
1716
* this software without specific prior written permission.
1817
*

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
/*
2-
* Copyright 2025, Google Inc. All rights reserved.
2+
* Copyright 2025 Google LLC
33
*
44
* Redistribution and use in source and binary forms, with or without
55
* modification, are permitted provided that the following conditions are
66
* met:
77
*
8-
* * Redistributions of source code must retain the above copyright
8+
* * Redistributions of source code must retain the above copyright
99
* notice, this list of conditions and the following disclaimer.
10-
* * Redistributions in binary form must reproduce the above
10+
* * Redistributions in binary form must reproduce the above
1111
* copyright notice, this list of conditions and the following disclaimer
1212
* in the documentation and/or other materials provided with the
1313
* distribution.
14-
*
15-
* * Neither the name of Google Inc. nor the names of its
14+
* * Neither the name of Google LLC nor the names of its
1615
* contributors may be used to endorse or promote products derived from
1716
* this software without specific prior written permission.
1817
*
@@ -43,8 +42,8 @@
4342
import java.util.Locale;
4443

4544
/**
46-
* This class provides certificate key stores to the Google Auth library transport layer via
47-
* certificate configuration files. This is only meant to be used internally to Google Cloud
45+
* This class implements {@link MtlsProvider} for the Google Auth library transport layer via {@link
46+
* WorkloadCertificateConfiguration}. This is only meant to be used internally by Google Cloud
4847
* libraries, and the public facing methods may be changed without notice, and have no guarantee of
4948
* backwards compatability.
5049
*/

0 commit comments

Comments
 (0)