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

feat: Adds support for custom audiences #107

Merged
merged 2 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
11 changes: 11 additions & 0 deletions google/cloud/run_v2/types/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,13 @@ class Service(proto.Message):
uri (str):
Output only. The main URI in which this
Service is serving traffic.
custom_audiences (MutableSequence[str]):
One or more custom audiences that you want
this service to support. Specify each custom
audience as the full URL in a string. The custom
audiences are encoded in the token and used to
authenticate requests. For more information, see
https://cloud.google.com/run/docs/configuring/custom-audiences.
satisfies_pzs (bool):
Output only. Reserved for future use.
reconciling (bool):
Expand Down Expand Up @@ -535,6 +542,10 @@ class Service(proto.Message):
proto.STRING,
number=36,
)
custom_audiences: MutableSequence[str] = proto.RepeatedField(
proto.STRING,
number=37,
)
satisfies_pzs: bool = proto.Field(
proto.BOOL,
number=38,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-run",
"version": "0.8.1"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
10 changes: 10 additions & 0 deletions tests/unit/gapic/run_v2/test_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,7 @@ def test_get_service(request_type, transport: str = "grpc"):
latest_ready_revision="latest_ready_revision_value",
latest_created_revision="latest_created_revision_value",
uri="uri_value",
custom_audiences=["custom_audiences_value"],
satisfies_pzs=True,
reconciling=True,
etag="etag_value",
Expand Down Expand Up @@ -962,6 +963,7 @@ def test_get_service(request_type, transport: str = "grpc"):
assert response.latest_ready_revision == "latest_ready_revision_value"
assert response.latest_created_revision == "latest_created_revision_value"
assert response.uri == "uri_value"
assert response.custom_audiences == ["custom_audiences_value"]
assert response.satisfies_pzs is True
assert response.reconciling is True
assert response.etag == "etag_value"
Expand Down Expand Up @@ -1015,6 +1017,7 @@ async def test_get_service_async(
latest_ready_revision="latest_ready_revision_value",
latest_created_revision="latest_created_revision_value",
uri="uri_value",
custom_audiences=["custom_audiences_value"],
satisfies_pzs=True,
reconciling=True,
etag="etag_value",
Expand Down Expand Up @@ -1043,6 +1046,7 @@ async def test_get_service_async(
assert response.latest_ready_revision == "latest_ready_revision_value"
assert response.latest_created_revision == "latest_created_revision_value"
assert response.uri == "uri_value"
assert response.custom_audiences == ["custom_audiences_value"]
assert response.satisfies_pzs is True
assert response.reconciling is True
assert response.etag == "etag_value"
Expand Down Expand Up @@ -2590,6 +2594,7 @@ def test_create_service_rest(request_type):
}
],
"uri": "uri_value",
"custom_audiences": ["custom_audiences_value1", "custom_audiences_value2"],
"satisfies_pzs": True,
"reconciling": True,
"etag": "etag_value",
Expand Down Expand Up @@ -2931,6 +2936,7 @@ def test_create_service_rest_bad_request(
}
],
"uri": "uri_value",
"custom_audiences": ["custom_audiences_value1", "custom_audiences_value2"],
"satisfies_pzs": True,
"reconciling": True,
"etag": "etag_value",
Expand Down Expand Up @@ -3048,6 +3054,7 @@ def test_get_service_rest(request_type):
latest_ready_revision="latest_ready_revision_value",
latest_created_revision="latest_created_revision_value",
uri="uri_value",
custom_audiences=["custom_audiences_value"],
satisfies_pzs=True,
reconciling=True,
etag="etag_value",
Expand Down Expand Up @@ -3079,6 +3086,7 @@ def test_get_service_rest(request_type):
assert response.latest_ready_revision == "latest_ready_revision_value"
assert response.latest_created_revision == "latest_created_revision_value"
assert response.uri == "uri_value"
assert response.custom_audiences == ["custom_audiences_value"]
assert response.satisfies_pzs is True
assert response.reconciling is True
assert response.etag == "etag_value"
Expand Down Expand Up @@ -3785,6 +3793,7 @@ def test_update_service_rest(request_type):
}
],
"uri": "uri_value",
"custom_audiences": ["custom_audiences_value1", "custom_audiences_value2"],
"satisfies_pzs": True,
"reconciling": True,
"etag": "etag_value",
Expand Down Expand Up @@ -4104,6 +4113,7 @@ def test_update_service_rest_bad_request(
}
],
"uri": "uri_value",
"custom_audiences": ["custom_audiences_value1", "custom_audiences_value2"],
"satisfies_pzs": True,
"reconciling": True,
"etag": "etag_value",
Expand Down