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

Commit 307bdf5

Browse files
fix(deps): require google-api-core>=1.32.0,>=2.8.0 (#175)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 459095142 Source-Link: googleapis/googleapis@4f1be99 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ae686d9cde4fc3e36d0ac02efb8643b15890c1ed Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWU2ODZkOWNkZTRmYzNlMzZkMGFjMDJlZmI4NjQzYjE1ODkwYzFlZCJ9 feat: add audience parameter PiperOrigin-RevId: 456827138 Source-Link: googleapis/googleapis@23f1a15 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4075a8514f676691ec156688a5bbf183aa9893ce Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDA3NWE4NTE0ZjY3NjY5MWVjMTU2Njg4YTViYmYxODNhYTk4OTNjZSJ9
1 parent 4c02583 commit 307bdf5

File tree

43 files changed

+546
-56
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+546
-56
lines changed

google/cloud/appengine_admin_v1/services/applications/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ def __init__(
404404
quota_project_id=client_options.quota_project_id,
405405
client_info=client_info,
406406
always_use_jwt_access=True,
407+
api_audience=client_options.api_audience,
407408
)
408409

409410
def get_application(

google/cloud/appengine_admin_v1/services/applications/transports/base.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def __init__(
6161
quota_project_id: Optional[str] = None,
6262
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
6363
always_use_jwt_access: Optional[bool] = False,
64+
api_audience: Optional[str] = None,
6465
**kwargs,
6566
) -> None:
6667
"""Instantiate the transport.
@@ -88,11 +89,6 @@ def __init__(
8889
be used for service account credentials.
8990
"""
9091

91-
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
92-
if ":" not in host:
93-
host += ":443"
94-
self._host = host
95-
9692
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}
9793

9894
# Save the scopes.
@@ -113,6 +109,11 @@ def __init__(
113109
credentials, _ = google.auth.default(
114110
**scopes_kwargs, quota_project_id=quota_project_id
115111
)
112+
# Don't apply audience if the credentials file passed from user.
113+
if hasattr(credentials, "with_gdch_audience"):
114+
credentials = credentials.with_gdch_audience(
115+
api_audience if api_audience else host
116+
)
116117

117118
# If the credentials are service account credentials, then always try to use self signed JWT.
118119
if (
@@ -125,6 +126,11 @@ def __init__(
125126
# Save the credentials.
126127
self._credentials = credentials
127128

129+
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
130+
if ":" not in host:
131+
host += ":443"
132+
self._host = host
133+
128134
def _prep_wrapped_messages(self, client_info):
129135
# Precompute the wrapped methods.
130136
self._wrapped_methods = {

google/cloud/appengine_admin_v1/services/applications/transports/grpc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def __init__(
6161
quota_project_id: Optional[str] = None,
6262
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
6363
always_use_jwt_access: Optional[bool] = False,
64+
api_audience: Optional[str] = None,
6465
) -> None:
6566
"""Instantiate the transport.
6667
@@ -157,6 +158,7 @@ def __init__(
157158
quota_project_id=quota_project_id,
158159
client_info=client_info,
159160
always_use_jwt_access=always_use_jwt_access,
161+
api_audience=api_audience,
160162
)
161163

162164
if not self._grpc_channel:

google/cloud/appengine_admin_v1/services/applications/transports/grpc_asyncio.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def __init__(
106106
quota_project_id=None,
107107
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
108108
always_use_jwt_access: Optional[bool] = False,
109+
api_audience: Optional[str] = None,
109110
) -> None:
110111
"""Instantiate the transport.
111112
@@ -202,6 +203,7 @@ def __init__(
202203
quota_project_id=quota_project_id,
203204
client_info=client_info,
204205
always_use_jwt_access=always_use_jwt_access,
206+
api_audience=api_audience,
205207
)
206208

207209
if not self._grpc_channel:

google/cloud/appengine_admin_v1/services/authorized_certificates/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ def __init__(
407407
quota_project_id=client_options.quota_project_id,
408408
client_info=client_info,
409409
always_use_jwt_access=True,
410+
api_audience=client_options.api_audience,
410411
)
411412

412413
def list_authorized_certificates(

google/cloud/appengine_admin_v1/services/authorized_certificates/transports/base.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def __init__(
6060
quota_project_id: Optional[str] = None,
6161
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
6262
always_use_jwt_access: Optional[bool] = False,
63+
api_audience: Optional[str] = None,
6364
**kwargs,
6465
) -> None:
6566
"""Instantiate the transport.
@@ -87,11 +88,6 @@ def __init__(
8788
be used for service account credentials.
8889
"""
8990

90-
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
91-
if ":" not in host:
92-
host += ":443"
93-
self._host = host
94-
9591
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}
9692

9793
# Save the scopes.
@@ -112,6 +108,11 @@ def __init__(
112108
credentials, _ = google.auth.default(
113109
**scopes_kwargs, quota_project_id=quota_project_id
114110
)
111+
# Don't apply audience if the credentials file passed from user.
112+
if hasattr(credentials, "with_gdch_audience"):
113+
credentials = credentials.with_gdch_audience(
114+
api_audience if api_audience else host
115+
)
115116

116117
# If the credentials are service account credentials, then always try to use self signed JWT.
117118
if (
@@ -124,6 +125,11 @@ def __init__(
124125
# Save the credentials.
125126
self._credentials = credentials
126127

128+
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
129+
if ":" not in host:
130+
host += ":443"
131+
self._host = host
132+
127133
def _prep_wrapped_messages(self, client_info):
128134
# Precompute the wrapped methods.
129135
self._wrapped_methods = {

google/cloud/appengine_admin_v1/services/authorized_certificates/transports/grpc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def __init__(
6262
quota_project_id: Optional[str] = None,
6363
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
6464
always_use_jwt_access: Optional[bool] = False,
65+
api_audience: Optional[str] = None,
6566
) -> None:
6667
"""Instantiate the transport.
6768
@@ -157,6 +158,7 @@ def __init__(
157158
quota_project_id=quota_project_id,
158159
client_info=client_info,
159160
always_use_jwt_access=always_use_jwt_access,
161+
api_audience=api_audience,
160162
)
161163

162164
if not self._grpc_channel:

google/cloud/appengine_admin_v1/services/authorized_certificates/transports/grpc_asyncio.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ def __init__(
107107
quota_project_id=None,
108108
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
109109
always_use_jwt_access: Optional[bool] = False,
110+
api_audience: Optional[str] = None,
110111
) -> None:
111112
"""Instantiate the transport.
112113
@@ -202,6 +203,7 @@ def __init__(
202203
quota_project_id=quota_project_id,
203204
client_info=client_info,
204205
always_use_jwt_access=always_use_jwt_access,
206+
api_audience=api_audience,
205207
)
206208

207209
if not self._grpc_channel:

google/cloud/appengine_admin_v1/services/authorized_domains/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@ def __init__(
406406
quota_project_id=client_options.quota_project_id,
407407
client_info=client_info,
408408
always_use_jwt_access=True,
409+
api_audience=client_options.api_audience,
409410
)
410411

411412
def list_authorized_domains(

google/cloud/appengine_admin_v1/services/authorized_domains/transports/base.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def __init__(
5858
quota_project_id: Optional[str] = None,
5959
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
6060
always_use_jwt_access: Optional[bool] = False,
61+
api_audience: Optional[str] = None,
6162
**kwargs,
6263
) -> None:
6364
"""Instantiate the transport.
@@ -85,11 +86,6 @@ def __init__(
8586
be used for service account credentials.
8687
"""
8788

88-
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
89-
if ":" not in host:
90-
host += ":443"
91-
self._host = host
92-
9389
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}
9490

9591
# Save the scopes.
@@ -110,6 +106,11 @@ def __init__(
110106
credentials, _ = google.auth.default(
111107
**scopes_kwargs, quota_project_id=quota_project_id
112108
)
109+
# Don't apply audience if the credentials file passed from user.
110+
if hasattr(credentials, "with_gdch_audience"):
111+
credentials = credentials.with_gdch_audience(
112+
api_audience if api_audience else host
113+
)
113114

114115
# If the credentials are service account credentials, then always try to use self signed JWT.
115116
if (
@@ -122,6 +123,11 @@ def __init__(
122123
# Save the credentials.
123124
self._credentials = credentials
124125

126+
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
127+
if ":" not in host:
128+
host += ":443"
129+
self._host = host
130+
125131
def _prep_wrapped_messages(self, client_info):
126132
# Precompute the wrapped methods.
127133
self._wrapped_methods = {

google/cloud/appengine_admin_v1/services/authorized_domains/transports/grpc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def __init__(
6060
quota_project_id: Optional[str] = None,
6161
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
6262
always_use_jwt_access: Optional[bool] = False,
63+
api_audience: Optional[str] = None,
6364
) -> None:
6465
"""Instantiate the transport.
6566
@@ -155,6 +156,7 @@ def __init__(
155156
quota_project_id=quota_project_id,
156157
client_info=client_info,
157158
always_use_jwt_access=always_use_jwt_access,
159+
api_audience=api_audience,
158160
)
159161

160162
if not self._grpc_channel:

google/cloud/appengine_admin_v1/services/authorized_domains/transports/grpc_asyncio.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ def __init__(
105105
quota_project_id=None,
106106
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
107107
always_use_jwt_access: Optional[bool] = False,
108+
api_audience: Optional[str] = None,
108109
) -> None:
109110
"""Instantiate the transport.
110111
@@ -200,6 +201,7 @@ def __init__(
200201
quota_project_id=quota_project_id,
201202
client_info=client_info,
202203
always_use_jwt_access=always_use_jwt_access,
204+
api_audience=api_audience,
203205
)
204206

205207
if not self._grpc_channel:

google/cloud/appengine_admin_v1/services/domain_mappings/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ def __init__(
407407
quota_project_id=client_options.quota_project_id,
408408
client_info=client_info,
409409
always_use_jwt_access=True,
410+
api_audience=client_options.api_audience,
410411
)
411412

412413
def list_domain_mappings(

google/cloud/appengine_admin_v1/services/domain_mappings/transports/base.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def __init__(
6161
quota_project_id: Optional[str] = None,
6262
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
6363
always_use_jwt_access: Optional[bool] = False,
64+
api_audience: Optional[str] = None,
6465
**kwargs,
6566
) -> None:
6667
"""Instantiate the transport.
@@ -88,11 +89,6 @@ def __init__(
8889
be used for service account credentials.
8990
"""
9091

91-
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
92-
if ":" not in host:
93-
host += ":443"
94-
self._host = host
95-
9692
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}
9793

9894
# Save the scopes.
@@ -113,6 +109,11 @@ def __init__(
113109
credentials, _ = google.auth.default(
114110
**scopes_kwargs, quota_project_id=quota_project_id
115111
)
112+
# Don't apply audience if the credentials file passed from user.
113+
if hasattr(credentials, "with_gdch_audience"):
114+
credentials = credentials.with_gdch_audience(
115+
api_audience if api_audience else host
116+
)
116117

117118
# If the credentials are service account credentials, then always try to use self signed JWT.
118119
if (
@@ -125,6 +126,11 @@ def __init__(
125126
# Save the credentials.
126127
self._credentials = credentials
127128

129+
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
130+
if ":" not in host:
131+
host += ":443"
132+
self._host = host
133+
128134
def _prep_wrapped_messages(self, client_info):
129135
# Precompute the wrapped methods.
130136
self._wrapped_methods = {

google/cloud/appengine_admin_v1/services/domain_mappings/transports/grpc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def __init__(
6161
quota_project_id: Optional[str] = None,
6262
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
6363
always_use_jwt_access: Optional[bool] = False,
64+
api_audience: Optional[str] = None,
6465
) -> None:
6566
"""Instantiate the transport.
6667
@@ -157,6 +158,7 @@ def __init__(
157158
quota_project_id=quota_project_id,
158159
client_info=client_info,
159160
always_use_jwt_access=always_use_jwt_access,
161+
api_audience=api_audience,
160162
)
161163

162164
if not self._grpc_channel:

google/cloud/appengine_admin_v1/services/domain_mappings/transports/grpc_asyncio.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def __init__(
106106
quota_project_id=None,
107107
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
108108
always_use_jwt_access: Optional[bool] = False,
109+
api_audience: Optional[str] = None,
109110
) -> None:
110111
"""Instantiate the transport.
111112
@@ -202,6 +203,7 @@ def __init__(
202203
quota_project_id=quota_project_id,
203204
client_info=client_info,
204205
always_use_jwt_access=always_use_jwt_access,
206+
api_audience=api_audience,
205207
)
206208

207209
if not self._grpc_channel:

google/cloud/appengine_admin_v1/services/firewall/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ def __init__(
412412
quota_project_id=client_options.quota_project_id,
413413
client_info=client_info,
414414
always_use_jwt_access=True,
415+
api_audience=client_options.api_audience,
415416
)
416417

417418
def list_ingress_rules(

google/cloud/appengine_admin_v1/services/firewall/transports/base.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ def __init__(
6060
quota_project_id: Optional[str] = None,
6161
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
6262
always_use_jwt_access: Optional[bool] = False,
63+
api_audience: Optional[str] = None,
6364
**kwargs,
6465
) -> None:
6566
"""Instantiate the transport.
@@ -87,11 +88,6 @@ def __init__(
8788
be used for service account credentials.
8889
"""
8990

90-
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
91-
if ":" not in host:
92-
host += ":443"
93-
self._host = host
94-
9591
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}
9692

9793
# Save the scopes.
@@ -112,6 +108,11 @@ def __init__(
112108
credentials, _ = google.auth.default(
113109
**scopes_kwargs, quota_project_id=quota_project_id
114110
)
111+
# Don't apply audience if the credentials file passed from user.
112+
if hasattr(credentials, "with_gdch_audience"):
113+
credentials = credentials.with_gdch_audience(
114+
api_audience if api_audience else host
115+
)
115116

116117
# If the credentials are service account credentials, then always try to use self signed JWT.
117118
if (
@@ -124,6 +125,11 @@ def __init__(
124125
# Save the credentials.
125126
self._credentials = credentials
126127

128+
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
129+
if ":" not in host:
130+
host += ":443"
131+
self._host = host
132+
127133
def _prep_wrapped_messages(self, client_info):
128134
# Precompute the wrapped methods.
129135
self._wrapped_methods = {

0 commit comments

Comments
 (0)