Skip to content
This repository was archived by the owner on Nov 9, 2024. It is now read-only.

Commit c2a27d7

Browse files
fix(deps): require google-api-core>=1.32.0,>=2.8.0 (#253)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 459858846 Source-Link: googleapis/googleapis@21ef848 Source-Link: https://github.com/googleapis/googleapis-gen/commit/26af3a384be4077c5f0100521a263fd9bd8fc7e7 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjZhZjNhMzg0YmU0MDc3YzVmMDEwMDUyMWEyNjNmZDliZDhmYzdlNyJ9 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 0b81da4 commit c2a27d7

14 files changed

Lines changed: 138 additions & 25 deletions

File tree

google-analytics-data-v1beta-py.tar.gz

Whitespace-only changes.

google/analytics/data_v1alpha/services/alpha_analytics_data/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ def __init__(
402402
quota_project_id=client_options.quota_project_id,
403403
client_info=client_info,
404404
always_use_jwt_access=True,
405+
api_audience=client_options.api_audience,
405406
)
406407

407408
def run_funnel_report(

google/analytics/data_v1alpha/services/alpha_analytics_data/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/analytics/data_v1alpha/services/alpha_analytics_data/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:

google/analytics/data_v1alpha/services/alpha_analytics_data/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:

google/analytics/data_v1beta/services/beta_analytics_data/client.py

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

422423
def run_report(

google/analytics/data_v1beta/services/beta_analytics_data/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/analytics/data_v1beta/services/beta_analytics_data/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:

google/analytics/data_v1beta/services/beta_analytics_data/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:

setup.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@
4545
platforms="Posix; MacOS X; Windows",
4646
include_package_data=True,
4747
install_requires=(
48-
# NOTE: Maintainers, please do not require google-api-core>=2.x.x
49-
# Until this issue is closed
50-
# https://github.com/googleapis/google-cloud-python/issues/10566
51-
"google-api-core[grpc] >= 1.31.5, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0",
48+
"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.*",
5249
"proto-plus >= 1.15.0, <2.0.0dev",
5350
"protobuf >= 3.19.0, <4.0.0dev",
5451
),

0 commit comments

Comments
 (0)