Skip to content

Commit 99f63ba

Browse files
committed
chore: Add warnings regarding consuming externally sourced credential configurations
1 parent c3ea09f commit 99f63ba

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

docs/user-guide.rst

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

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

3444
Application default credentials

google/auth/_default.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,16 @@ def load_credentials_from_file(
8585
user credentials, external account credentials, or impersonated service
8686
account credentials.
8787
88+
Important: If you accept a credential configuration (credential JSON/File/Stream)
89+
from an external source for authentication to Google Cloud Platform, you must
90+
validate it before providing it to any Google API or client library. Providing an
91+
unvalidated credential configuration to Google APIs or libraries can compromise
92+
the security of your systems and data. For more information, refer to
93+
`Validate credential configurations from external sources`_
94+
95+
.. _Validate credential configurations from external sources: https://\
96+
cloud.google.com/docs/authentication/external/externally-sourced-credentials
97+
8898
Args:
8999
filename (str): The full path to the credentials file.
90100
scopes (Optional[Sequence[str]]): The list of scopes for the credentials. If
@@ -137,6 +147,16 @@ def load_credentials_from_dict(
137147
user credentials, external account credentials, or impersonated service
138148
account credentials.
139149
150+
Important: If you accept a credential configuration (credential JSON/File/Stream)
151+
from an external source for authentication to Google Cloud Platform, you must
152+
validate it before providing it to any Google API or client library. Providing an
153+
unvalidated credential configuration to Google APIs or libraries can compromise
154+
the security of your systems and data. For more information, refer to
155+
`Validate credential configurations from external sources`_
156+
157+
.. _Validate credential configurations from external sources: https://\
158+
cloud.google.com/docs/authentication/external/externally-sourced-credentials
159+
140160
Args:
141161
info (Dict[str, Any]): A dict object containing the credentials
142162
scopes (Optional[Sequence[str]]): The list of scopes for the credentials. If
@@ -593,6 +613,15 @@ def default(scopes=None, request=None, quota_project_id=None, default_scopes=Non
593613
5. If no credentials are found,
594614
:class:`~google.auth.exceptions.DefaultCredentialsError` will be raised.
595615
616+
Important: If you accept a credential configuration (credential JSON/File/Stream)
617+
from an external source for authentication to Google Cloud Platform, you must
618+
validate it before providing it to any Google API or client library. Providing an
619+
unvalidated credential configuration to Google APIs or libraries can compromise
620+
the security of your systems and data. For more information, refer to
621+
`Validate credential configurations from external sources`_
622+
623+
.. _Validate credential configurations from external sources: https://\
624+
cloud.google.com/docs/authentication/external/externally-sourced-credentials
596625
.. _Application Default Credentials: https://developers.google.com\
597626
/identity/protocols/application-default-credentials
598627
.. _Google Cloud SDK: https://cloud.google.com/sdk

system_tests/secrets.tar.enc

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)