Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ class {{ service.name }}Transport(abc.ABC):
self._extended_operations_services: Dict[str, Any] = {}
{% endif %}

scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
self._scopes = scopes
if not hasattr(self, "_ignore_credentials"):
Expand All @@ -123,11 +121,12 @@ class {{ service.name }}Transport(abc.ABC):
if credentials_file is not None:
credentials, _ = google.auth.load_credentials_from_file(
credentials_file,
**scopes_kwargs,
quota_project_id=quota_project_id
scopes=scopes,
quota_project_id=quota_project_id,
default_scopes=self.AUTH_SCOPES,
)
elif credentials is None and not self._ignore_credentials:
credentials, _ = google.auth.default(**scopes_kwargs, quota_project_id=quota_project_id)
credentials, _ = google.auth.default(scopes=scopes, quota_project_id=quota_project_id, default_scopes=self.AUTH_SCOPES)
# Don't apply audience if the credentials file passed from user.
if hasattr(credentials, "with_gdch_audience"):
credentials = credentials.with_gdch_audience(api_audience if api_audience else host)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ def __init__(
be used for service account credentials.
"""

scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
self._scopes = scopes
if not hasattr(self, "_ignore_credentials"):
Expand All @@ -100,11 +98,12 @@ def __init__(
if credentials_file is not None:
credentials, _ = google.auth.load_credentials_from_file(
credentials_file,
**scopes_kwargs,
quota_project_id=quota_project_id
scopes=scopes,
quota_project_id=quota_project_id,
default_scopes=self.AUTH_SCOPES,
)
elif credentials is None and not self._ignore_credentials:
credentials, _ = google.auth.default(**scopes_kwargs, quota_project_id=quota_project_id)
credentials, _ = google.auth.default(scopes=scopes, quota_project_id=quota_project_id, default_scopes=self.AUTH_SCOPES)
# Don't apply audience if the credentials file passed from user.
if hasattr(credentials, "with_gdch_audience"):
credentials = credentials.with_gdch_audience(api_audience if api_audience else host)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ def __init__(
be used for service account credentials.
"""

scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
self._scopes = scopes
if not hasattr(self, "_ignore_credentials"):
Expand All @@ -97,11 +95,12 @@ def __init__(
if credentials_file is not None:
credentials, _ = google.auth.load_credentials_from_file(
credentials_file,
**scopes_kwargs,
quota_project_id=quota_project_id
scopes=scopes,
quota_project_id=quota_project_id,
default_scopes=self.AUTH_SCOPES,
)
elif credentials is None and not self._ignore_credentials:
credentials, _ = google.auth.default(**scopes_kwargs, quota_project_id=quota_project_id)
credentials, _ = google.auth.default(scopes=scopes, quota_project_id=quota_project_id, default_scopes=self.AUTH_SCOPES)
# Don't apply audience if the credentials file passed from user.
if hasattr(credentials, "with_gdch_audience"):
credentials = credentials.with_gdch_audience(api_audience if api_audience else host)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ def __init__(
be used for service account credentials.
"""

scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
self._scopes = scopes
if not hasattr(self, "_ignore_credentials"):
Expand All @@ -108,11 +106,12 @@ def __init__(
if credentials_file is not None:
credentials, _ = google.auth.load_credentials_from_file(
credentials_file,
**scopes_kwargs,
quota_project_id=quota_project_id
scopes=scopes,
quota_project_id=quota_project_id,
default_scopes=self.AUTH_SCOPES,
)
elif credentials is None and not self._ignore_credentials:
credentials, _ = google.auth.default(**scopes_kwargs, quota_project_id=quota_project_id)
credentials, _ = google.auth.default(scopes=scopes, quota_project_id=quota_project_id, default_scopes=self.AUTH_SCOPES)
# Don't apply audience if the credentials file passed from user.
if hasattr(credentials, "with_gdch_audience"):
credentials = credentials.with_gdch_audience(api_audience if api_audience else host)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ def __init__(
be used for service account credentials.
"""

scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
self._scopes = scopes
if not hasattr(self, "_ignore_credentials"):
Expand All @@ -103,11 +101,12 @@ def __init__(
if credentials_file is not None:
credentials, _ = google.auth.load_credentials_from_file(
credentials_file,
**scopes_kwargs,
quota_project_id=quota_project_id
scopes=scopes,
quota_project_id=quota_project_id,
default_scopes=self.AUTH_SCOPES,
)
elif credentials is None and not self._ignore_credentials:
credentials, _ = google.auth.default(**scopes_kwargs, quota_project_id=quota_project_id)
credentials, _ = google.auth.default(scopes=scopes, quota_project_id=quota_project_id, default_scopes=self.AUTH_SCOPES)
# Don't apply audience if the credentials file passed from user.
if hasattr(credentials, "with_gdch_audience"):
credentials = credentials.with_gdch_audience(api_audience if api_audience else host)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ def __init__(
be used for service account credentials.
"""

scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
self._scopes = scopes
if not hasattr(self, "_ignore_credentials"):
Expand All @@ -103,11 +101,12 @@ def __init__(
if credentials_file is not None:
credentials, _ = google.auth.load_credentials_from_file(
credentials_file,
**scopes_kwargs,
quota_project_id=quota_project_id
scopes=scopes,
quota_project_id=quota_project_id,
default_scopes=self.AUTH_SCOPES,
)
elif credentials is None and not self._ignore_credentials:
credentials, _ = google.auth.default(**scopes_kwargs, quota_project_id=quota_project_id)
credentials, _ = google.auth.default(scopes=scopes, quota_project_id=quota_project_id, default_scopes=self.AUTH_SCOPES)
# Don't apply audience if the credentials file passed from user.
if hasattr(credentials, "with_gdch_audience"):
credentials = credentials.with_gdch_audience(api_audience if api_audience else host)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ def __init__(
be used for service account credentials.
"""

scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
self._scopes = scopes
if not hasattr(self, "_ignore_credentials"):
Expand All @@ -103,11 +101,12 @@ def __init__(
if credentials_file is not None:
credentials, _ = google.auth.load_credentials_from_file(
credentials_file,
**scopes_kwargs,
quota_project_id=quota_project_id
scopes=scopes,
quota_project_id=quota_project_id,
default_scopes=self.AUTH_SCOPES,
)
elif credentials is None and not self._ignore_credentials:
credentials, _ = google.auth.default(**scopes_kwargs, quota_project_id=quota_project_id)
credentials, _ = google.auth.default(scopes=scopes, quota_project_id=quota_project_id, default_scopes=self.AUTH_SCOPES)
# Don't apply audience if the credentials file passed from user.
if hasattr(credentials, "with_gdch_audience"):
credentials = credentials.with_gdch_audience(api_audience if api_audience else host)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ def __init__(
be used for service account credentials.
"""

scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
self._scopes = scopes
if not hasattr(self, "_ignore_credentials"):
Expand All @@ -103,11 +101,12 @@ def __init__(
if credentials_file is not None:
credentials, _ = google.auth.load_credentials_from_file(
credentials_file,
**scopes_kwargs,
quota_project_id=quota_project_id
scopes=scopes,
quota_project_id=quota_project_id,
default_scopes=self.AUTH_SCOPES,
)
elif credentials is None and not self._ignore_credentials:
credentials, _ = google.auth.default(**scopes_kwargs, quota_project_id=quota_project_id)
credentials, _ = google.auth.default(scopes=scopes, quota_project_id=quota_project_id, default_scopes=self.AUTH_SCOPES)
# Don't apply audience if the credentials file passed from user.
if hasattr(credentials, "with_gdch_audience"):
credentials = credentials.with_gdch_audience(api_audience if api_audience else host)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ def __init__(
be used for service account credentials.
"""

scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
self._scopes = scopes
if not hasattr(self, "_ignore_credentials"):
Expand All @@ -103,11 +101,12 @@ def __init__(
if credentials_file is not None:
credentials, _ = google.auth.load_credentials_from_file(
credentials_file,
**scopes_kwargs,
quota_project_id=quota_project_id
scopes=scopes,
quota_project_id=quota_project_id,
default_scopes=self.AUTH_SCOPES,
)
elif credentials is None and not self._ignore_credentials:
credentials, _ = google.auth.default(**scopes_kwargs, quota_project_id=quota_project_id)
credentials, _ = google.auth.default(scopes=scopes, quota_project_id=quota_project_id, default_scopes=self.AUTH_SCOPES)
# Don't apply audience if the credentials file passed from user.
if hasattr(credentials, "with_gdch_audience"):
credentials = credentials.with_gdch_audience(api_audience if api_audience else host)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ def __init__(
be used for service account credentials.
"""

scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
self._scopes = scopes
if not hasattr(self, "_ignore_credentials"):
Expand All @@ -103,11 +101,12 @@ def __init__(
if credentials_file is not None:
credentials, _ = google.auth.load_credentials_from_file(
credentials_file,
**scopes_kwargs,
quota_project_id=quota_project_id
scopes=scopes,
quota_project_id=quota_project_id,
default_scopes=self.AUTH_SCOPES,
)
elif credentials is None and not self._ignore_credentials:
credentials, _ = google.auth.default(**scopes_kwargs, quota_project_id=quota_project_id)
credentials, _ = google.auth.default(scopes=scopes, quota_project_id=quota_project_id, default_scopes=self.AUTH_SCOPES)
# Don't apply audience if the credentials file passed from user.
if hasattr(credentials, "with_gdch_audience"):
credentials = credentials.with_gdch_audience(api_audience if api_audience else host)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ def __init__(
be used for service account credentials.
"""

scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
self._scopes = scopes
if not hasattr(self, "_ignore_credentials"):
Expand All @@ -100,11 +98,12 @@ def __init__(
if credentials_file is not None:
credentials, _ = google.auth.load_credentials_from_file(
credentials_file,
**scopes_kwargs,
quota_project_id=quota_project_id
scopes=scopes,
quota_project_id=quota_project_id,
default_scopes=self.AUTH_SCOPES,
)
elif credentials is None and not self._ignore_credentials:
credentials, _ = google.auth.default(**scopes_kwargs, quota_project_id=quota_project_id)
credentials, _ = google.auth.default(scopes=scopes, quota_project_id=quota_project_id, default_scopes=self.AUTH_SCOPES)
# Don't apply audience if the credentials file passed from user.
if hasattr(credentials, "with_gdch_audience"):
credentials = credentials.with_gdch_audience(api_audience if api_audience else host)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ def __init__(
be used for service account credentials.
"""

scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}

# Save the scopes.
self._scopes = scopes
if not hasattr(self, "_ignore_credentials"):
Expand All @@ -100,11 +98,12 @@ def __init__(
if credentials_file is not None:
credentials, _ = google.auth.load_credentials_from_file(
credentials_file,
**scopes_kwargs,
quota_project_id=quota_project_id
scopes=scopes,
quota_project_id=quota_project_id,
default_scopes=self.AUTH_SCOPES,
)
elif credentials is None and not self._ignore_credentials:
credentials, _ = google.auth.default(**scopes_kwargs, quota_project_id=quota_project_id)
credentials, _ = google.auth.default(scopes=scopes, quota_project_id=quota_project_id, default_scopes=self.AUTH_SCOPES)
# Don't apply audience if the credentials file passed from user.
if hasattr(credentials, "with_gdch_audience"):
credentials = credentials.with_gdch_audience(api_audience if api_audience else host)
Expand Down
Loading