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

Commit 8f2963d

Browse files
fix(deps): require google-api-core>=1.32.0,>=2.8.0 (#110)
- [ ] 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 d694565 commit 8f2963d

File tree

13 files changed

+138
-25
lines changed

13 files changed

+138
-25
lines changed

google/cloud/debugger_v2/services/controller2/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ def __init__(
422422
quota_project_id=client_options.quota_project_id,
423423
client_info=client_info,
424424
always_use_jwt_access=True,
425+
api_audience=client_options.api_audience,
425426
)
426427

427428
def register_debuggee(

google/cloud/debugger_v2/services/controller2/transports/base.py

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

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

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

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

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

google/cloud/debugger_v2/services/controller2/transports/grpc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def __init__(
7979
quota_project_id: Optional[str] = None,
8080
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
8181
always_use_jwt_access: Optional[bool] = False,
82+
api_audience: Optional[str] = None,
8283
) -> None:
8384
"""Instantiate the transport.
8485
@@ -174,6 +175,7 @@ def __init__(
174175
quota_project_id=quota_project_id,
175176
client_info=client_info,
176177
always_use_jwt_access=always_use_jwt_access,
178+
api_audience=api_audience,
177179
)
178180

179181
if not self._grpc_channel:

google/cloud/debugger_v2/services/controller2/transports/grpc_asyncio.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ def __init__(
124124
quota_project_id=None,
125125
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
126126
always_use_jwt_access: Optional[bool] = False,
127+
api_audience: Optional[str] = None,
127128
) -> None:
128129
"""Instantiate the transport.
129130
@@ -219,6 +220,7 @@ def __init__(
219220
quota_project_id=quota_project_id,
220221
client_info=client_info,
221222
always_use_jwt_access=always_use_jwt_access,
223+
api_audience=api_audience,
222224
)
223225

224226
if not self._grpc_channel:

google/cloud/debugger_v2/services/debugger2/client.py

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

418419
def set_breakpoint(

google/cloud/debugger_v2/services/debugger2/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/debugger_v2/services/debugger2/transports/grpc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def __init__(
7171
quota_project_id: Optional[str] = None,
7272
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
7373
always_use_jwt_access: Optional[bool] = False,
74+
api_audience: Optional[str] = None,
7475
) -> None:
7576
"""Instantiate the transport.
7677
@@ -166,6 +167,7 @@ def __init__(
166167
quota_project_id=quota_project_id,
167168
client_info=client_info,
168169
always_use_jwt_access=always_use_jwt_access,
170+
api_audience=api_audience,
169171
)
170172

171173
if not self._grpc_channel:

google/cloud/debugger_v2/services/debugger2/transports/grpc_asyncio.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ def __init__(
116116
quota_project_id=None,
117117
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
118118
always_use_jwt_access: Optional[bool] = False,
119+
api_audience: Optional[str] = None,
119120
) -> None:
120121
"""Instantiate the transport.
121122
@@ -211,6 +212,7 @@ def __init__(
211212
quota_project_id=quota_project_id,
212213
client_info=client_info,
213214
always_use_jwt_access=always_use_jwt_access,
215+
api_audience=api_audience,
214216
)
215217

216218
if not self._grpc_channel:

setup.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@
2525
release_status = "Development Status :: 5 - Production/Stable"
2626
url = "https://github.com/googleapis/python-debugger-client"
2727
dependencies = [
28-
# NOTE: Maintainers, please do not require google-api-core>=2.x.x
29-
# Until this issue is closed
30-
# https://github.com/googleapis/google-cloud-python/issues/10566
31-
"google-api-core[grpc] >= 1.31.5, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0",
28+
"google-api-core[grpc] >= 1.32.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*",
3229
"proto-plus >= 1.15.0, <2.0.0dev",
3330
"protobuf >= 3.19.0, <4.0.0dev",
3431
"google-cloud-source-context >= 1.0.0, <2.0.0dev",

testing/constraints-3.6.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)