Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

Commit

Permalink
🦉 Updates from OwlBot
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] committed Jun 14, 2021
1 parent 3a25253 commit 8e05584
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore
from google.oauth2 import service_account # type: ignore

from google.cloud.kms_v1.types import resources
from google.cloud.kms_v1.types import service
Expand Down Expand Up @@ -119,9 +119,11 @@ def __init__(
credentials, _ = google.auth.default(
**scopes_kwargs, quota_project_id=quota_project_id
)

# If the credentials is service account credentials, then always try to use self signed JWT.
if isinstance(credentials, service_account.Credentials) and hasattr(service_account.Credentials, "with_always_use_jwt_access"):
if isinstance(credentials, service_account.Credentials) and hasattr(
service_account.Credentials, "with_always_use_jwt_access"
):
credentials = credentials.with_always_use_jwt_access(True)

# Save the credentials.
Expand Down

0 comments on commit 8e05584

Please sign in to comment.