From 9601e7dee17fed8c15efdb7ed9637372e7797382 Mon Sep 17 00:00:00 2001 From: Sai Sunder Srinivasan Date: Thu, 16 Jan 2025 22:17:29 +0000 Subject: [PATCH] update warning syntax --- docs/user-guide.rst | 13 +++++++------ google/auth/_default.py | 30 ++++++++++++++++-------------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/docs/user-guide.rst b/docs/user-guide.rst index 0d11129cf..04dffaf89 100644 --- a/docs/user-guide.rst +++ b/docs/user-guide.rst @@ -29,12 +29,13 @@ that supports OpenID Connect (OIDC). Obtaining credentials --------------------- -.. warning:::Important: If you accept a credential configuration (credential JSON/File/Stream) -from an external source for authentication to Google Cloud Platform, you must -validate it before providing it to any Google API or client library. Providing an -unvalidated credential configuration to Google APIs or libraries can compromise -the security of your systems and data. For more information, refer to -`Validate credential configurations from external sources`_. +.. warning:: + Important: If you accept a credential configuration (credential JSON/File/Stream) + from an external source for authentication to Google Cloud Platform, you must + validate it before providing it to any Google API or client library. Providing an + unvalidated credential configuration to Google APIs or libraries can compromise + the security of your systems and data. For more information, refer to + `Validate credential configurations from external sources`_. .. _Validate credential configurations from external sources: https://cloud.google.com/docs/authentication/external/externally-sourced-credentials diff --git a/google/auth/_default.py b/google/auth/_default.py index 61cb4f0f2..1234fb25d 100644 --- a/google/auth/_default.py +++ b/google/auth/_default.py @@ -85,15 +85,16 @@ def load_credentials_from_file( user credentials, external account credentials, or impersonated service account credentials. - .. warning:::Important: If you accept a credential configuration (credential JSON/File/Stream) - from an external source for authentication to Google Cloud Platform, you must - validate it before providing it to any Google API or client library. Providing an - unvalidated credential configuration to Google APIs or libraries can compromise - the security of your systems and data. For more information, refer to - `Validate credential configurations from external sources`_. + .. warning:: + Important: If you accept a credential configuration (credential JSON/File/Stream) + from an external source for authentication to Google Cloud Platform, you must + validate it before providing it to any Google API or client library. Providing an + unvalidated credential configuration to Google APIs or libraries can compromise + the security of your systems and data. For more information, refer to + `Validate credential configurations from external sources`_. - .. _Validate credential configurations from external sources: - https://cloud.google.com/docs/authentication/external/externally-sourced-credentials + .. _Validate credential configurations from external sources: + https://cloud.google.com/docs/authentication/external/externally-sourced-credentials Args: filename (str): The full path to the credentials file. @@ -147,12 +148,13 @@ def load_credentials_from_dict( user credentials, external account credentials, or impersonated service account credentials. - .. warning:::Important: If you accept a credential configuration (credential JSON/File/Stream) - from an external source for authentication to Google Cloud Platform, you must - validate it before providing it to any Google API or client library. Providing an - unvalidated credential configuration to Google APIs or libraries can compromise - the security of your systems and data. For more information, refer to - `Validate credential configurations from external sources`_. + .. warning:: + Important: If you accept a credential configuration (credential JSON/File/Stream) + from an external source for authentication to Google Cloud Platform, you must + validate it before providing it to any Google API or client library. Providing an + unvalidated credential configuration to Google APIs or libraries can compromise + the security of your systems and data. For more information, refer to + `Validate credential configurations from external sources`_. .. _Validate credential configurations from external sources: https://cloud.google.com/docs/authentication/external/externally-sourced-credentials