Skip to content

Commit ac7a473

Browse files
fix(deps): require google-api-core>=1.32.0,>=2.8.0 (#124)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 459095142 Source-Link: googleapis/googleapis@4f1be99 Source-Link: googleapis/googleapis-gen@ae686d9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWU2ODZkOWNkZTRmYzNlMzZkMGFjMDJlZmI4NjQzYjE1ODkwYzFlZCJ9 feat: add audience parameter PiperOrigin-RevId: 456827138 Source-Link: googleapis/googleapis@23f1a15 Source-Link: googleapis/googleapis-gen@4075a85 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDA3NWE4NTE0ZjY3NjY5MWVjMTU2Njg4YTViYmYxODNhYTk4OTNjZSJ9
1 parent cf8e5db commit ac7a473

13 files changed

Lines changed: 138 additions & 25 deletions

File tree

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/connection_service/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 list_connections(

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/connection_service/transports/base.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def __init__(
5454
quota_project_id: Optional[str] = None,
5555
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
5656
always_use_jwt_access: Optional[bool] = False,
57+
api_audience: Optional[str] = None,
5758
**kwargs,
5859
) -> None:
5960
"""Instantiate the transport.
@@ -81,11 +82,6 @@ def __init__(
8182
be used for service account credentials.
8283
"""
8384

84-
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
85-
if ":" not in host:
86-
host += ":443"
87-
self._host = host
88-
8985
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}
9086

9187
# Save the scopes.
@@ -106,6 +102,11 @@ def __init__(
106102
credentials, _ = google.auth.default(
107103
**scopes_kwargs, quota_project_id=quota_project_id
108104
)
105+
# Don't apply audience if the credentials file passed from user.
106+
if hasattr(credentials, "with_gdch_audience"):
107+
credentials = credentials.with_gdch_audience(
108+
api_audience if api_audience else host
109+
)
109110

110111
# If the credentials are service account credentials, then always try to use self signed JWT.
111112
if (
@@ -118,6 +119,11 @@ def __init__(
118119
# Save the credentials.
119120
self._credentials = credentials
120121

122+
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
123+
if ":" not in host:
124+
host += ":443"
125+
self._host = host
126+
121127
def _prep_wrapped_messages(self, client_info):
122128
# Precompute the wrapped methods.
123129
self._wrapped_methods = {

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/connection_service/transports/grpc.py

Lines changed: 2 additions & 0 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
) -> None:
6263
"""Instantiate the transport.
6364
@@ -153,6 +154,7 @@ def __init__(
153154
quota_project_id=quota_project_id,
154155
client_info=client_info,
155156
always_use_jwt_access=always_use_jwt_access,
157+
api_audience=api_audience,
156158
)
157159

158160
if not self._grpc_channel:

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/connection_service/transports/grpc_asyncio.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ def __init__(
103103
quota_project_id=None,
104104
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
105105
always_use_jwt_access: Optional[bool] = False,
106+
api_audience: Optional[str] = None,
106107
) -> None:
107108
"""Instantiate the transport.
108109
@@ -198,6 +199,7 @@ def __init__(
198199
quota_project_id=quota_project_id,
199200
client_info=client_info,
200201
always_use_jwt_access=always_use_jwt_access,
202+
api_audience=api_audience,
201203
)
202204

203205
if not self._grpc_channel:

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/tether/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@ def __init__(
416416
quota_project_id=client_options.quota_project_id,
417417
client_info=client_info,
418418
always_use_jwt_access=True,
419+
api_audience=client_options.api_audience,
419420
)
420421

421422
def egress(

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/tether/transports/base.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def __init__(
5454
quota_project_id: Optional[str] = None,
5555
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
5656
always_use_jwt_access: Optional[bool] = False,
57+
api_audience: Optional[str] = None,
5758
**kwargs,
5859
) -> None:
5960
"""Instantiate the transport.
@@ -81,11 +82,6 @@ def __init__(
8182
be used for service account credentials.
8283
"""
8384

84-
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
85-
if ":" not in host:
86-
host += ":443"
87-
self._host = host
88-
8985
scopes_kwargs = {"scopes": scopes, "default_scopes": self.AUTH_SCOPES}
9086

9187
# Save the scopes.
@@ -106,6 +102,11 @@ def __init__(
106102
credentials, _ = google.auth.default(
107103
**scopes_kwargs, quota_project_id=quota_project_id
108104
)
105+
# Don't apply audience if the credentials file passed from user.
106+
if hasattr(credentials, "with_gdch_audience"):
107+
credentials = credentials.with_gdch_audience(
108+
api_audience if api_audience else host
109+
)
109110

110111
# If the credentials are service account credentials, then always try to use self signed JWT.
111112
if (
@@ -118,6 +119,11 @@ def __init__(
118119
# Save the credentials.
119120
self._credentials = credentials
120121

122+
# Save the hostname. Default to port 443 (HTTPS) if none is specified.
123+
if ":" not in host:
124+
host += ":443"
125+
self._host = host
126+
121127
def _prep_wrapped_messages(self, client_info):
122128
# Precompute the wrapped methods.
123129
self._wrapped_methods = {

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/tether/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:

packages/google-cloud-apigee-connect/google/cloud/apigeeconnect_v1/services/tether/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:

packages/google-cloud-apigee-connect/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-apigee-connect"
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
]

packages/google-cloud-apigee-connect/testing/constraints-3.6.txt

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

0 commit comments

Comments
 (0)