Skip to content

Commit d049370

Browse files
authored
chore: Add warnings regarding consuming externally sourced credentials (#1655)
* chore: Add warnings regarding consuming externally sourced credential configurations * update syntax * remove in ADC * period * make it warning * update warning syntax * update secret after rebase
1 parent 34ee3fe commit d049370

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

docs/user-guide.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,17 @@ that supports OpenID Connect (OIDC).
2929
Obtaining credentials
3030
---------------------
3131

32+
.. warning::
33+
Important: If you accept a credential configuration (credential JSON/File/Stream)
34+
from an external source for authentication to Google Cloud Platform, you must
35+
validate it before providing it to any Google API or client library. Providing an
36+
unvalidated credential configuration to Google APIs or libraries can compromise
37+
the security of your systems and data. For more information, refer to
38+
`Validate credential configurations from external sources`_.
39+
40+
.. _Validate credential configurations from external sources:
41+
https://cloud.google.com/docs/authentication/external/externally-sourced-credentials
42+
3243
.. _application-default:
3344

3445
Application default credentials

google/auth/_default.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,17 @@ def load_credentials_from_file(
8585
user credentials, external account credentials, or impersonated service
8686
account credentials.
8787
88+
.. warning::
89+
Important: If you accept a credential configuration (credential JSON/File/Stream)
90+
from an external source for authentication to Google Cloud Platform, you must
91+
validate it before providing it to any Google API or client library. Providing an
92+
unvalidated credential configuration to Google APIs or libraries can compromise
93+
the security of your systems and data. For more information, refer to
94+
`Validate credential configurations from external sources`_.
95+
96+
.. _Validate credential configurations from external sources:
97+
https://cloud.google.com/docs/authentication/external/externally-sourced-credentials
98+
8899
Args:
89100
filename (str): The full path to the credentials file.
90101
scopes (Optional[Sequence[str]]): The list of scopes for the credentials. If
@@ -137,6 +148,17 @@ def load_credentials_from_dict(
137148
user credentials, external account credentials, or impersonated service
138149
account credentials.
139150
151+
.. warning::
152+
Important: If you accept a credential configuration (credential JSON/File/Stream)
153+
from an external source for authentication to Google Cloud Platform, you must
154+
validate it before providing it to any Google API or client library. Providing an
155+
unvalidated credential configuration to Google APIs or libraries can compromise
156+
the security of your systems and data. For more information, refer to
157+
`Validate credential configurations from external sources`_.
158+
159+
.. _Validate credential configurations from external sources:
160+
https://cloud.google.com/docs/authentication/external/externally-sourced-credentials
161+
140162
Args:
141163
info (Dict[str, Any]): A dict object containing the credentials
142164
scopes (Optional[Sequence[str]]): The list of scopes for the credentials. If

system_tests/secrets.tar.enc

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)