Skip to content

Commit 7ac88c2

Browse files
1 parent ffc4341 commit 7ac88c2

8 files changed

Lines changed: 282 additions & 9 deletions

src/NetworkSecurity/AuthzPolicy.php

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,25 @@ class AuthzPolicy extends \Google\Collection
3535
* Delegate the authorization decision to an external authorization engine.
3636
*/
3737
public const ACTION_CUSTOM = 'CUSTOM';
38+
/**
39+
* Unspecified policy profile.
40+
*/
41+
public const POLICY_PROFILE_POLICY_PROFILE_UNSPECIFIED = 'POLICY_PROFILE_UNSPECIFIED';
42+
/**
43+
* Applies to request authorization. `CUSTOM` authorization policies with
44+
* Authz extensions will be allowed with `EXT_AUTHZ_GRPC` or `EXT_PROC_GRPC`
45+
* protocols. Extensions are invoked only for request header events.
46+
*/
47+
public const POLICY_PROFILE_REQUEST_AUTHZ = 'REQUEST_AUTHZ';
48+
/**
49+
* Applies to content security, sanitization, etc. Only `CUSTOM` action is
50+
* allowed in this policy profile. AuthzExtensions in the custom provider must
51+
* support `EXT_PROC_GRPC` protocol only and be capable of receiving all
52+
* `EXT_PROC_GRPC` events (REQUEST_HEADERS, REQUEST_BODY, REQUEST_TRAILERS,
53+
* RESPONSE_HEADERS, RESPONSE_BODY, RESPONSE_TRAILERS) with
54+
* `FULL_DUPLEX_STREAMED` body send mode.
55+
*/
56+
public const POLICY_PROFILE_CONTENT_AUTHZ = 'CONTENT_AUTHZ';
3857
protected $collection_key = 'httpRules';
3958
/**
4059
* Required. Can be one of `ALLOW`, `DENY`, `CUSTOM`. When the action is
@@ -86,6 +105,14 @@ class AuthzPolicy extends \Google\Collection
86105
* @var string
87106
*/
88107
public $name;
108+
/**
109+
* Optional. Immutable. Defines the type of authorization being performed. If
110+
* not specified, `REQUEST_AUTHZ` is applied. This field cannot be changed
111+
* once AuthzPolicy is created.
112+
*
113+
* @var string
114+
*/
115+
public $policyProfile;
89116
protected $targetType = AuthzPolicyTarget::class;
90117
protected $targetDataType = '';
91118
/**
@@ -230,6 +257,26 @@ public function getName()
230257
{
231258
return $this->name;
232259
}
260+
/**
261+
* Optional. Immutable. Defines the type of authorization being performed. If
262+
* not specified, `REQUEST_AUTHZ` is applied. This field cannot be changed
263+
* once AuthzPolicy is created.
264+
*
265+
* Accepted values: POLICY_PROFILE_UNSPECIFIED, REQUEST_AUTHZ, CONTENT_AUTHZ
266+
*
267+
* @param self::POLICY_PROFILE_* $policyProfile
268+
*/
269+
public function setPolicyProfile($policyProfile)
270+
{
271+
$this->policyProfile = $policyProfile;
272+
}
273+
/**
274+
* @return self::POLICY_PROFILE_*
275+
*/
276+
public function getPolicyProfile()
277+
{
278+
return $this->policyProfile;
279+
}
233280
/**
234281
* Required. Specifies the set of resources to which this policy should be
235282
* applied to.

src/NetworkSecurity/AuthzPolicyAuthzRuleToRequestOperation.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class AuthzPolicyAuthzRuleToRequestOperation extends \Google\Collection
2424
protected $headerSetDataType = '';
2525
protected $hostsType = AuthzPolicyAuthzRuleStringMatch::class;
2626
protected $hostsDataType = 'array';
27+
protected $mcpType = AuthzPolicyAuthzRuleToRequestOperationMCP::class;
28+
protected $mcpDataType = '';
2729
/**
2830
* Optional. A list of HTTP methods to match against. Each entry must be a
2931
* valid HTTP method name (GET, PUT, POST, HEAD, PATCH, DELETE, OPTIONS). It
@@ -71,6 +73,25 @@ public function getHosts()
7173
{
7274
return $this->hosts;
7375
}
76+
/**
77+
* Optional. Defines the MCP protocol attributes to match on. If the MCP
78+
* payload in the request body cannot be successfully parsed, the request will
79+
* be denied. This field can be set only for AuthzPolicies targeting
80+
* AgentGateway resources.
81+
*
82+
* @param AuthzPolicyAuthzRuleToRequestOperationMCP $mcp
83+
*/
84+
public function setMcp(AuthzPolicyAuthzRuleToRequestOperationMCP $mcp)
85+
{
86+
$this->mcp = $mcp;
87+
}
88+
/**
89+
* @return AuthzPolicyAuthzRuleToRequestOperationMCP
90+
*/
91+
public function getMcp()
92+
{
93+
return $this->mcp;
94+
}
7495
/**
7596
* Optional. A list of HTTP methods to match against. Each entry must be a
7697
* valid HTTP method name (GET, PUT, POST, HEAD, PATCH, DELETE, OPTIONS). It
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
<?php
2+
/*
3+
* Copyright 2014 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
* use this file except in compliance with the License. You may obtain a copy of
7+
* the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
namespace Google\Service\NetworkSecurity;
19+
20+
class AuthzPolicyAuthzRuleToRequestOperationMCP extends \Google\Collection
21+
{
22+
/**
23+
* Unspecified option. Defaults to SKIP_BASE_PROTOCOL_METHODS.
24+
*/
25+
public const BASE_PROTOCOL_METHODS_OPTION_BASE_PROTOCOL_METHODS_OPTION_UNSPECIFIED = 'BASE_PROTOCOL_METHODS_OPTION_UNSPECIFIED';
26+
/**
27+
* Skip matching on the base MCP protocol methods.
28+
*/
29+
public const BASE_PROTOCOL_METHODS_OPTION_SKIP_BASE_PROTOCOL_METHODS = 'SKIP_BASE_PROTOCOL_METHODS';
30+
/**
31+
* Match on the base MCP protocol methods.
32+
*/
33+
public const BASE_PROTOCOL_METHODS_OPTION_MATCH_BASE_PROTOCOL_METHODS = 'MATCH_BASE_PROTOCOL_METHODS';
34+
protected $collection_key = 'methods';
35+
/**
36+
* Optional. If specified, matches on the MCP protocol’s non-access specific
37+
* methods namely: * initialize * completion/ * logging/ * notifications/ *
38+
* ping Defaults to SKIP_BASE_PROTOCOL_METHODS if not specified.
39+
*
40+
* @var string
41+
*/
42+
public $baseProtocolMethodsOption;
43+
protected $methodsType = AuthzPolicyAuthzRuleToRequestOperationMCPMethod::class;
44+
protected $methodsDataType = 'array';
45+
46+
/**
47+
* Optional. If specified, matches on the MCP protocol’s non-access specific
48+
* methods namely: * initialize * completion/ * logging/ * notifications/ *
49+
* ping Defaults to SKIP_BASE_PROTOCOL_METHODS if not specified.
50+
*
51+
* Accepted values: BASE_PROTOCOL_METHODS_OPTION_UNSPECIFIED,
52+
* SKIP_BASE_PROTOCOL_METHODS, MATCH_BASE_PROTOCOL_METHODS
53+
*
54+
* @param self::BASE_PROTOCOL_METHODS_OPTION_* $baseProtocolMethodsOption
55+
*/
56+
public function setBaseProtocolMethodsOption($baseProtocolMethodsOption)
57+
{
58+
$this->baseProtocolMethodsOption = $baseProtocolMethodsOption;
59+
}
60+
/**
61+
* @return self::BASE_PROTOCOL_METHODS_OPTION_*
62+
*/
63+
public function getBaseProtocolMethodsOption()
64+
{
65+
return $this->baseProtocolMethodsOption;
66+
}
67+
/**
68+
* Optional. A list of MCP methods and associated parameters to match on. It
69+
* is recommended to use this field to match on tools, prompts and resource
70+
* accesses while setting the baseProtocolMethodsOption to
71+
* MATCH_BASE_PROTOCOL_METHODS to match on all the other MCP protocol methods.
72+
* Limited to 10 MCP methods per Authorization Policy.
73+
*
74+
* @param AuthzPolicyAuthzRuleToRequestOperationMCPMethod[] $methods
75+
*/
76+
public function setMethods($methods)
77+
{
78+
$this->methods = $methods;
79+
}
80+
/**
81+
* @return AuthzPolicyAuthzRuleToRequestOperationMCPMethod[]
82+
*/
83+
public function getMethods()
84+
{
85+
return $this->methods;
86+
}
87+
}
88+
89+
// Adding a class alias for backwards compatibility with the previous class name.
90+
class_alias(AuthzPolicyAuthzRuleToRequestOperationMCP::class, 'Google_Service_NetworkSecurity_AuthzPolicyAuthzRuleToRequestOperationMCP');
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?php
2+
/*
3+
* Copyright 2014 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
* use this file except in compliance with the License. You may obtain a copy of
7+
* the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
namespace Google\Service\NetworkSecurity;
19+
20+
class AuthzPolicyAuthzRuleToRequestOperationMCPMethod extends \Google\Collection
21+
{
22+
protected $collection_key = 'params';
23+
/**
24+
* Required. The MCP method to match against. Allowed values are as follows:
25+
* 1. `tools`, `prompts`, `resources` - these will match against all sub
26+
* methods under the respective methods. 2. `prompts/list`, `tools/list`,
27+
* `resources/list`, `resources/templates/list` 3. `prompts/get`,
28+
* `tools/call`, `resources/subscribe`, `resources/unsubscribe`,
29+
* `resources/read` Params cannot be specified for categories 1 and 2.
30+
*
31+
* @var string
32+
*/
33+
public $name;
34+
protected $paramsType = AuthzPolicyAuthzRuleStringMatch::class;
35+
protected $paramsDataType = 'array';
36+
37+
/**
38+
* Required. The MCP method to match against. Allowed values are as follows:
39+
* 1. `tools`, `prompts`, `resources` - these will match against all sub
40+
* methods under the respective methods. 2. `prompts/list`, `tools/list`,
41+
* `resources/list`, `resources/templates/list` 3. `prompts/get`,
42+
* `tools/call`, `resources/subscribe`, `resources/unsubscribe`,
43+
* `resources/read` Params cannot be specified for categories 1 and 2.
44+
*
45+
* @param string $name
46+
*/
47+
public function setName($name)
48+
{
49+
$this->name = $name;
50+
}
51+
/**
52+
* @return string
53+
*/
54+
public function getName()
55+
{
56+
return $this->name;
57+
}
58+
/**
59+
* Optional. A list of MCP method parameters to match against. The match can
60+
* be one of exact, prefix, suffix, or contains (substring match). Matches are
61+
* always case sensitive unless the ignoreCase is set. Limited to 10 MCP
62+
* method parameters per Authorization Policy.
63+
*
64+
* @param AuthzPolicyAuthzRuleStringMatch[] $params
65+
*/
66+
public function setParams($params)
67+
{
68+
$this->params = $params;
69+
}
70+
/**
71+
* @return AuthzPolicyAuthzRuleStringMatch[]
72+
*/
73+
public function getParams()
74+
{
75+
return $this->params;
76+
}
77+
}
78+
79+
// Adding a class alias for backwards compatibility with the previous class name.
80+
class_alias(AuthzPolicyAuthzRuleToRequestOperationMCPMethod::class, 'Google_Service_NetworkSecurity_AuthzPolicyAuthzRuleToRequestOperationMCPMethod');

src/NetworkSecurity/AuthzPolicyTarget.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class AuthzPolicyTarget extends \Google\Collection
4040
public const LOAD_BALANCING_SCHEME_INTERNAL_SELF_MANAGED = 'INTERNAL_SELF_MANAGED';
4141
protected $collection_key = 'resources';
4242
/**
43-
* Required. All gateways and forwarding rules referenced by this policy and
43+
* Optional. All gateways and forwarding rules referenced by this policy and
4444
* extensions must share the same load balancing scheme. Supported values:
4545
* `INTERNAL_MANAGED` and `EXTERNAL_MANAGED`. For more information, refer to
4646
* [Backend services overview](https://cloud.google.com/load-
@@ -58,7 +58,7 @@ class AuthzPolicyTarget extends \Google\Collection
5858
public $resources;
5959

6060
/**
61-
* Required. All gateways and forwarding rules referenced by this policy and
61+
* Optional. All gateways and forwarding rules referenced by this policy and
6262
* extensions must share the same load balancing scheme. Supported values:
6363
* `INTERNAL_MANAGED` and `EXTERNAL_MANAGED`. For more information, refer to
6464
* [Backend services overview](https://cloud.google.com/load-

src/NetworkSecurity/FirewallEndpoint.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ class FirewallEndpoint extends \Google\Collection
5454
protected $associationsType = FirewallEndpointAssociationReference::class;
5555
protected $associationsDataType = 'array';
5656
/**
57-
* Required. Project to bill on endpoint uptime usage.
57+
* Optional. Project to charge for the deployed firewall endpoint. This field
58+
* must be specified when creating the endpoint in the organization scope, and
59+
* should be omitted otherwise.
5860
*
5961
* @var string
6062
*/
@@ -158,7 +160,9 @@ public function getAssociations()
158160
return $this->associations;
159161
}
160162
/**
161-
* Required. Project to bill on endpoint uptime usage.
163+
* Optional. Project to charge for the deployed firewall endpoint. This field
164+
* must be specified when creating the endpoint in the organization scope, and
165+
* should be omitted otherwise.
162166
*
163167
* @param string $billingProjectId
164168
*/

src/NetworkSecurity/InterceptEndpointGroupAssociation.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@ class InterceptEndpointGroupAssociation extends \Google\Collection
9898
* @var string
9999
*/
100100
public $network;
101+
/**
102+
* Output only. Identifier used by the data-path. See the NSI GENEVE format
103+
* for more details: https://docs.cloud.google.com/network-security-
104+
* integration/docs/understand-geneve#network_id
105+
*
106+
* @var string
107+
*/
108+
public $networkCookie;
101109
/**
102110
* Output only. The current state of the resource does not match the user's
103111
* intended state, and the system is working to reconcile them. This part of
@@ -248,6 +256,24 @@ public function getNetwork()
248256
{
249257
return $this->network;
250258
}
259+
/**
260+
* Output only. Identifier used by the data-path. See the NSI GENEVE format
261+
* for more details: https://docs.cloud.google.com/network-security-
262+
* integration/docs/understand-geneve#network_id
263+
*
264+
* @param string $networkCookie
265+
*/
266+
public function setNetworkCookie($networkCookie)
267+
{
268+
$this->networkCookie = $networkCookie;
269+
}
270+
/**
271+
* @return string
272+
*/
273+
public function getNetworkCookie()
274+
{
275+
return $this->networkCookie;
276+
}
251277
/**
252278
* Output only. The current state of the resource does not match the user's
253279
* intended state, and the system is working to reconcile them. This part of

src/NetworkSecurity/Resource/ProjectsLocations.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,16 @@ public function get($name, $optParams = [])
4646
}
4747
/**
4848
* Lists information about the supported locations for this service. This method
49-
* can be called in two ways: * **List all public locations:** Use the path `GET
50-
* /v1/locations`. * **List project-visible locations:** Use the path `GET
51-
* /v1/projects/{project_id}/locations`. This may include public locations as
52-
* well as private or other locations specifically visible to the project.
53-
* (locations.listProjectsLocations)
49+
* lists locations based on the resource scope provided in the
50+
* [ListLocationsRequest.name] field: * **Global locations**: If `name` is
51+
* empty, the method lists the public locations available to all projects. *
52+
* **Project-specific locations**: If `name` follows the format
53+
* `projects/{project}`, the method lists locations visible to that specific
54+
* project. This includes public, private, or other project-specific locations
55+
* enabled for the project. For gRPC and client library implementations, the
56+
* resource name is passed as the `name` field. For direct service calls, the
57+
* resource name is incorporated into the request path based on the specific
58+
* service implementation and version. (locations.listProjectsLocations)
5459
*
5560
* @param string $name The resource that owns the locations collection, if
5661
* applicable.

0 commit comments

Comments
 (0)