Skip to content

Commit 9114e1d

Browse files
feat: [google-cloud-iap] Identity-aware Proxy (IAP) released a feature Use IAP with Workforce Identity Federation (#13751)
- [ ] Regenerate this pull request now. feat: [google-cloud-iap] Identity-aware Proxy (IAP) released a feature `Use IAP with Workforce Identity Federation`(https://cloud.google.com/iap/docs/use-workforce-identity-federation) at Feb 7, 2025. Two settings field are newly introduced in the feature release: `AccessSettings.workforce_identity_settings` and `AccessSettings.identity_sources` BEGIN_COMMIT_OVERRIDE feat: Use IAP with Workforce Identity Federation feat: Add fields `AccessSettings.workforce_identity_settings` and `AccessSettings.identity_sources` docs: A comment for field `name` in message `.google.cloud.iap.v1.TunnelDestGroup` is changed docs: A comment for field `cidrs` in message `.google.cloud.iap.v1.TunnelDestGroup` is changed docs: A comment for field `fqdns` in message `.google.cloud.iap.v1.TunnelDestGroup` is changed docs: Mark `access_settings` in message `.google.cloud.iap.v1.IapSettings` as optional docs: Mark `application_settings` in message `.google.cloud.iap.v1.IapSettings` as optional docs: Mark `gcip_settings` in message `.google.cloud.iap.v1.AccessSettings` as optional docs: Mark `cors_settings` in message `.google.cloud.iap.v1.AccessSettings` as optional docs: Mark `oauth_settings` in message `.google.cloud.iap.v1.AccessSettings` as optional docs: Mark `reauth_settings` in message `.google.cloud.iap.v1.AccessSettings` as optional docs: Mark `allowed_domains_settings` in message `.google.cloud.iap.v1.AccessSettings` as optional docs: Mark `tenant_ids` in message `.google.cloud.iap.v1.GcipSettings` as optional docs: Mark `programmatic_clients` in message `.google.cloud.iap.v1.OAuthSettings` as optional docs: A comment for enum `PolicyType` is changed docs: Mark `method` in message `.google.cloud.iap.v1.ReauthSettings` as optional docs: Mark `max_age` in message `.google.cloud.iap.v1.ReauthSettings` as optional docs: Mark `policy_type` in message `.google.cloud.iap.v1.ReauthSettings` as optional docs: Mark `enable` in message `.google.cloud.iap.v1.AllowedDomainsSettings` as optional docs: Mark `domains` in message `.google.cloud.iap.v1.AllowedDomainsSettings` as optional docs: Mark `csm_settings` in message `.google.cloud.iap.v1.ApplicationSettings` as optional docs: Mark `access_denied_page_settings` in message `.google.cloud.iap.v1.ApplicationSettings` as optional docs: Mark `attribute_propagation_settings` in message `.google.cloud.iap.v1.ApplicationSettings` as optional docs: Mark `expression` in message `.google.cloud.iap.v1.AttributePropagationSettings` as optional docs: Mark `output_credentials` in message `.google.cloud.iap.v1.AttributePropagationSettings` as optional docs: Mark `enable` in message `.google.cloud.iap.v1.AttributePropagationSettings` as optional END_COMMIT_OVERRIDE PiperOrigin-RevId: 745722681 Source-Link: googleapis/googleapis@81dd948 Source-Link: googleapis/googleapis-gen@553184a Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWlhcC8uT3dsQm90LnlhbWwiLCJoIjoiNTUzMTg0YTdjZDdlMWM1ODI0OTVmYjFmOGNkMDBlYzBmNjZhZmY2ZCJ9 --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 5535afe commit 9114e1d

21 files changed

+1675
-114
lines changed

packages/google-cloud-iap/google/cloud/iap/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,16 @@
5757
ListIdentityAwareProxyClientsResponse,
5858
ListTunnelDestGroupsRequest,
5959
ListTunnelDestGroupsResponse,
60+
OAuth2,
6061
OAuthSettings,
6162
ReauthSettings,
6263
ResetIdentityAwareProxyClientSecretRequest,
6364
TunnelDestGroup,
6465
UpdateIapSettingsRequest,
6566
UpdateTunnelDestGroupRequest,
67+
ValidateIapAttributeExpressionRequest,
68+
ValidateIapAttributeExpressionResponse,
69+
WorkforceIdentitySettings,
6670
)
6771

6872
__all__ = (
@@ -96,10 +100,14 @@
96100
"ListIdentityAwareProxyClientsResponse",
97101
"ListTunnelDestGroupsRequest",
98102
"ListTunnelDestGroupsResponse",
103+
"OAuth2",
99104
"OAuthSettings",
100105
"ReauthSettings",
101106
"ResetIdentityAwareProxyClientSecretRequest",
102107
"TunnelDestGroup",
103108
"UpdateIapSettingsRequest",
104109
"UpdateTunnelDestGroupRequest",
110+
"ValidateIapAttributeExpressionRequest",
111+
"ValidateIapAttributeExpressionResponse",
112+
"WorkforceIdentitySettings",
105113
)

packages/google-cloud-iap/google/cloud/iap_v1/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,16 @@
5353
ListIdentityAwareProxyClientsResponse,
5454
ListTunnelDestGroupsRequest,
5555
ListTunnelDestGroupsResponse,
56+
OAuth2,
5657
OAuthSettings,
5758
ReauthSettings,
5859
ResetIdentityAwareProxyClientSecretRequest,
5960
TunnelDestGroup,
6061
UpdateIapSettingsRequest,
6162
UpdateTunnelDestGroupRequest,
63+
ValidateIapAttributeExpressionRequest,
64+
ValidateIapAttributeExpressionResponse,
65+
WorkforceIdentitySettings,
6266
)
6367

6468
__all__ = (
@@ -92,10 +96,14 @@
9296
"ListIdentityAwareProxyClientsResponse",
9397
"ListTunnelDestGroupsRequest",
9498
"ListTunnelDestGroupsResponse",
99+
"OAuth2",
95100
"OAuthSettings",
96101
"ReauthSettings",
97102
"ResetIdentityAwareProxyClientSecretRequest",
98103
"TunnelDestGroup",
99104
"UpdateIapSettingsRequest",
100105
"UpdateTunnelDestGroupRequest",
106+
"ValidateIapAttributeExpressionRequest",
107+
"ValidateIapAttributeExpressionResponse",
108+
"WorkforceIdentitySettings",
101109
)

packages/google-cloud-iap/google/cloud/iap_v1/gapic_metadata.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@
5959
"methods": [
6060
"update_tunnel_dest_group"
6161
]
62+
},
63+
"ValidateIapAttributeExpression": {
64+
"methods": [
65+
"validate_iap_attribute_expression"
66+
]
6267
}
6368
}
6469
},
@@ -114,6 +119,11 @@
114119
"methods": [
115120
"update_tunnel_dest_group"
116121
]
122+
},
123+
"ValidateIapAttributeExpression": {
124+
"methods": [
125+
"validate_iap_attribute_expression"
126+
]
117127
}
118128
}
119129
},
@@ -169,6 +179,11 @@
169179
"methods": [
170180
"update_tunnel_dest_group"
171181
]
182+
},
183+
"ValidateIapAttributeExpression": {
184+
"methods": [
185+
"validate_iap_attribute_expression"
186+
]
172187
}
173188
}
174189
}

packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/async_client.py

Lines changed: 90 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,96 @@ async def sample_update_iap_settings():
817817
# Done; return the response.
818818
return response
819819

820+
async def validate_iap_attribute_expression(
821+
self,
822+
request: Optional[
823+
Union[service.ValidateIapAttributeExpressionRequest, dict]
824+
] = None,
825+
*,
826+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
827+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
828+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
829+
) -> service.ValidateIapAttributeExpressionResponse:
830+
r"""Validates that a given CEL expression conforms to IAP
831+
restrictions.
832+
833+
.. code-block:: python
834+
835+
# This snippet has been automatically generated and should be regarded as a
836+
# code template only.
837+
# It will require modifications to work:
838+
# - It may require correct/in-range values for request initialization.
839+
# - It may require specifying regional endpoints when creating the service
840+
# client as shown in:
841+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
842+
from google.cloud import iap_v1
843+
844+
async def sample_validate_iap_attribute_expression():
845+
# Create a client
846+
client = iap_v1.IdentityAwareProxyAdminServiceAsyncClient()
847+
848+
# Initialize request argument(s)
849+
request = iap_v1.ValidateIapAttributeExpressionRequest(
850+
name="name_value",
851+
expression="expression_value",
852+
)
853+
854+
# Make the request
855+
response = await client.validate_iap_attribute_expression(request=request)
856+
857+
# Handle the response
858+
print(response)
859+
860+
Args:
861+
request (Optional[Union[google.cloud.iap_v1.types.ValidateIapAttributeExpressionRequest, dict]]):
862+
The request object. Request sent to IAP Expression Linter
863+
endpoint.
864+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
865+
should be retried.
866+
timeout (float): The timeout for this request.
867+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
868+
sent along with the request as metadata. Normally, each value must be of type `str`,
869+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
870+
be of type `bytes`.
871+
872+
Returns:
873+
google.cloud.iap_v1.types.ValidateIapAttributeExpressionResponse:
874+
IAP Expression Linter endpoint
875+
returns empty response body.
876+
877+
"""
878+
# Create or coerce a protobuf request object.
879+
# - Use the request object if provided (there's no risk of modifying the input as
880+
# there are no flattened fields), or create one.
881+
if not isinstance(request, service.ValidateIapAttributeExpressionRequest):
882+
request = service.ValidateIapAttributeExpressionRequest(request)
883+
884+
# Wrap the RPC method; this adds retry and timeout information,
885+
# and friendly error handling.
886+
rpc = self._client._transport._wrapped_methods[
887+
self._client._transport.validate_iap_attribute_expression
888+
]
889+
890+
# Certain fields should be provided within the metadata header;
891+
# add these here.
892+
metadata = tuple(metadata) + (
893+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
894+
)
895+
896+
# Validate the universe domain.
897+
self._client._validate_universe_domain()
898+
899+
# Send the request.
900+
response = await rpc(
901+
request,
902+
retry=retry,
903+
timeout=timeout,
904+
metadata=metadata,
905+
)
906+
907+
# Done; return the response.
908+
return response
909+
820910
async def list_tunnel_dest_groups(
821911
self,
822912
request: Optional[Union[service.ListTunnelDestGroupsRequest, dict]] = None,
@@ -976,12 +1066,8 @@ async def sample_create_tunnel_dest_group():
9761066
client = iap_v1.IdentityAwareProxyAdminServiceAsyncClient()
9771067
9781068
# Initialize request argument(s)
979-
tunnel_dest_group = iap_v1.TunnelDestGroup()
980-
tunnel_dest_group.name = "name_value"
981-
9821069
request = iap_v1.CreateTunnelDestGroupRequest(
9831070
parent="parent_value",
984-
tunnel_dest_group=tunnel_dest_group,
9851071
tunnel_dest_group_id="tunnel_dest_group_id_value",
9861072
)
9871073
@@ -1320,11 +1406,7 @@ async def sample_update_tunnel_dest_group():
13201406
client = iap_v1.IdentityAwareProxyAdminServiceAsyncClient()
13211407
13221408
# Initialize request argument(s)
1323-
tunnel_dest_group = iap_v1.TunnelDestGroup()
1324-
tunnel_dest_group.name = "name_value"
1325-
13261409
request = iap_v1.UpdateTunnelDestGroupRequest(
1327-
tunnel_dest_group=tunnel_dest_group,
13281410
)
13291411
13301412
# Make the request

packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/client.py

Lines changed: 90 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,6 +1249,96 @@ def sample_update_iap_settings():
12491249
# Done; return the response.
12501250
return response
12511251

1252+
def validate_iap_attribute_expression(
1253+
self,
1254+
request: Optional[
1255+
Union[service.ValidateIapAttributeExpressionRequest, dict]
1256+
] = None,
1257+
*,
1258+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1259+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1260+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1261+
) -> service.ValidateIapAttributeExpressionResponse:
1262+
r"""Validates that a given CEL expression conforms to IAP
1263+
restrictions.
1264+
1265+
.. code-block:: python
1266+
1267+
# This snippet has been automatically generated and should be regarded as a
1268+
# code template only.
1269+
# It will require modifications to work:
1270+
# - It may require correct/in-range values for request initialization.
1271+
# - It may require specifying regional endpoints when creating the service
1272+
# client as shown in:
1273+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
1274+
from google.cloud import iap_v1
1275+
1276+
def sample_validate_iap_attribute_expression():
1277+
# Create a client
1278+
client = iap_v1.IdentityAwareProxyAdminServiceClient()
1279+
1280+
# Initialize request argument(s)
1281+
request = iap_v1.ValidateIapAttributeExpressionRequest(
1282+
name="name_value",
1283+
expression="expression_value",
1284+
)
1285+
1286+
# Make the request
1287+
response = client.validate_iap_attribute_expression(request=request)
1288+
1289+
# Handle the response
1290+
print(response)
1291+
1292+
Args:
1293+
request (Union[google.cloud.iap_v1.types.ValidateIapAttributeExpressionRequest, dict]):
1294+
The request object. Request sent to IAP Expression Linter
1295+
endpoint.
1296+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
1297+
should be retried.
1298+
timeout (float): The timeout for this request.
1299+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1300+
sent along with the request as metadata. Normally, each value must be of type `str`,
1301+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
1302+
be of type `bytes`.
1303+
1304+
Returns:
1305+
google.cloud.iap_v1.types.ValidateIapAttributeExpressionResponse:
1306+
IAP Expression Linter endpoint
1307+
returns empty response body.
1308+
1309+
"""
1310+
# Create or coerce a protobuf request object.
1311+
# - Use the request object if provided (there's no risk of modifying the input as
1312+
# there are no flattened fields), or create one.
1313+
if not isinstance(request, service.ValidateIapAttributeExpressionRequest):
1314+
request = service.ValidateIapAttributeExpressionRequest(request)
1315+
1316+
# Wrap the RPC method; this adds retry and timeout information,
1317+
# and friendly error handling.
1318+
rpc = self._transport._wrapped_methods[
1319+
self._transport.validate_iap_attribute_expression
1320+
]
1321+
1322+
# Certain fields should be provided within the metadata header;
1323+
# add these here.
1324+
metadata = tuple(metadata) + (
1325+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
1326+
)
1327+
1328+
# Validate the universe domain.
1329+
self._validate_universe_domain()
1330+
1331+
# Send the request.
1332+
response = rpc(
1333+
request,
1334+
retry=retry,
1335+
timeout=timeout,
1336+
metadata=metadata,
1337+
)
1338+
1339+
# Done; return the response.
1340+
return response
1341+
12521342
def list_tunnel_dest_groups(
12531343
self,
12541344
request: Optional[Union[service.ListTunnelDestGroupsRequest, dict]] = None,
@@ -1405,12 +1495,8 @@ def sample_create_tunnel_dest_group():
14051495
client = iap_v1.IdentityAwareProxyAdminServiceClient()
14061496
14071497
# Initialize request argument(s)
1408-
tunnel_dest_group = iap_v1.TunnelDestGroup()
1409-
tunnel_dest_group.name = "name_value"
1410-
14111498
request = iap_v1.CreateTunnelDestGroupRequest(
14121499
parent="parent_value",
1413-
tunnel_dest_group=tunnel_dest_group,
14141500
tunnel_dest_group_id="tunnel_dest_group_id_value",
14151501
)
14161502
@@ -1740,11 +1826,7 @@ def sample_update_tunnel_dest_group():
17401826
client = iap_v1.IdentityAwareProxyAdminServiceClient()
17411827
17421828
# Initialize request argument(s)
1743-
tunnel_dest_group = iap_v1.TunnelDestGroup()
1744-
tunnel_dest_group.name = "name_value"
1745-
17461829
request = iap_v1.UpdateTunnelDestGroupRequest(
1747-
tunnel_dest_group=tunnel_dest_group,
17481830
)
17491831
17501832
# Make the request

packages/google-cloud-iap/google/cloud/iap_v1/services/identity_aware_proxy_admin_service/transports/base.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ def _prep_wrapped_messages(self, client_info):
156156
default_timeout=None,
157157
client_info=client_info,
158158
),
159+
self.validate_iap_attribute_expression: gapic_v1.method.wrap_method(
160+
self.validate_iap_attribute_expression,
161+
default_timeout=None,
162+
client_info=client_info,
163+
),
159164
self.list_tunnel_dest_groups: gapic_v1.method.wrap_method(
160165
self.list_tunnel_dest_groups,
161166
default_timeout=None,
@@ -240,6 +245,18 @@ def update_iap_settings(
240245
]:
241246
raise NotImplementedError()
242247

248+
@property
249+
def validate_iap_attribute_expression(
250+
self,
251+
) -> Callable[
252+
[service.ValidateIapAttributeExpressionRequest],
253+
Union[
254+
service.ValidateIapAttributeExpressionResponse,
255+
Awaitable[service.ValidateIapAttributeExpressionResponse],
256+
],
257+
]:
258+
raise NotImplementedError()
259+
243260
@property
244261
def list_tunnel_dest_groups(
245262
self,

0 commit comments

Comments
 (0)