Skip to content

Commit a768f72

Browse files
feat: [ConfidentialComputing] Add new VerifyConfidentialSpace and VerifyConfidentialGke rpcs and relevant fields (#8549)
* feat: Add new `VerifyConfidentialSpace` and `VerifyConfidentialGke` rpcs and relevant fields fix!: Move `AwsPrincipalTagsOptions` out from `TokenOptions` message docs: Updated comment for method `VerifyAttestation`, `VerifyAttestationRequest` and `VerifyAttestationResponse` in service `ConfidentialComputing` is changed docs: A comment for field `aws_principal_tags_options` in message `.google.cloud.confidentialcomputing.v1.TokenOptions` is changed PiperOrigin-RevId: 800806196 Source-Link: googleapis/googleapis@bf9ef0b Source-Link: googleapis/googleapis-gen@4744f98 Copy-Tag: eyJwIjoiQ29uZmlkZW50aWFsQ29tcHV0aW5nLy5Pd2xCb3QueWFtbCIsImgiOiI0NzQ0Zjk4YTlkYmY5YThlYmYwN2Y0YmVkNWY4MDcyMzgyNTkzOTQ2In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 3a1c213 commit a768f72

24 files changed

Lines changed: 1802 additions & 14 deletions
2.13 KB
Binary file not shown.

ConfidentialComputing/samples/V1/ConfidentialComputingClient/verify_attestation.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
use Google\Cloud\ConfidentialComputing\V1\VerifyAttestationResponse;
3131

3232
/**
33-
* Verifies the provided attestation info, returning a signed OIDC token.
33+
* Verifies the provided attestation info, returning a signed attestation
34+
* token.
3435
*
3536
* @param string $formattedChallenge The name of the Challenge whose nonce was used to generate the
3637
* attestation, in the format `projects/&#42;/locations/&#42;/challenges/*`. The
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?php
2+
/*
3+
* Copyright 2025 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://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,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
require_once __DIR__ . '/../../../vendor/autoload.php';
24+
25+
// [START confidentialcomputing_v1_generated_ConfidentialComputing_VerifyConfidentialGke_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\ConfidentialComputing\V1\Client\ConfidentialComputingClient;
28+
use Google\Cloud\ConfidentialComputing\V1\VerifyConfidentialGkeRequest;
29+
use Google\Cloud\ConfidentialComputing\V1\VerifyConfidentialGkeResponse;
30+
31+
/**
32+
* Verifies the provided Confidential GKE attestation info, returning a signed
33+
* OIDC token.
34+
*
35+
* @param string $formattedChallenge The name of the Challenge whose nonce was used to generate the
36+
* attestation, in the format projects/&#42;/locations/&#42;/challenges/*. The
37+
* provided Challenge will be consumed, and cannot be used again. Please see
38+
* {@see ConfidentialComputingClient::challengeName()} for help formatting this field.
39+
*/
40+
function verify_confidential_gke_sample(string $formattedChallenge): void
41+
{
42+
// Create a client.
43+
$confidentialComputingClient = new ConfidentialComputingClient();
44+
45+
// Prepare the request message.
46+
$request = (new VerifyConfidentialGkeRequest())
47+
->setChallenge($formattedChallenge);
48+
49+
// Call the API and handle any network failures.
50+
try {
51+
/** @var VerifyConfidentialGkeResponse $response */
52+
$response = $confidentialComputingClient->verifyConfidentialGke($request);
53+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
54+
} catch (ApiException $ex) {
55+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
56+
}
57+
}
58+
59+
/**
60+
* Helper to execute the sample.
61+
*
62+
* This sample has been automatically generated and should be regarded as a code
63+
* template only. It will require modifications to work:
64+
* - It may require correct/in-range values for request initialization.
65+
* - It may require specifying regional endpoints when creating the service client,
66+
* please see the apiEndpoint client configuration option for more details.
67+
*/
68+
function callSample(): void
69+
{
70+
$formattedChallenge = ConfidentialComputingClient::challengeName(
71+
'[PROJECT]',
72+
'[LOCATION]',
73+
'[UUID]'
74+
);
75+
76+
verify_confidential_gke_sample($formattedChallenge);
77+
}
78+
// [END confidentialcomputing_v1_generated_ConfidentialComputing_VerifyConfidentialGke_sync]
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?php
2+
/*
3+
* Copyright 2025 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://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,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
require_once __DIR__ . '/../../../vendor/autoload.php';
24+
25+
// [START confidentialcomputing_v1_generated_ConfidentialComputing_VerifyConfidentialSpace_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\ConfidentialComputing\V1\Client\ConfidentialComputingClient;
28+
use Google\Cloud\ConfidentialComputing\V1\VerifyConfidentialSpaceRequest;
29+
use Google\Cloud\ConfidentialComputing\V1\VerifyConfidentialSpaceResponse;
30+
31+
/**
32+
* Verifies whether the provided attestation info is valid, returning a signed
33+
* attestation token if so.
34+
*
35+
* @param string $formattedChallenge The name of the Challenge whose nonce was used to generate the
36+
* attestation, in the format `projects/&#42;/locations/&#42;/challenges/*`. The
37+
* provided Challenge will be consumed, and cannot be used again. Please see
38+
* {@see ConfidentialComputingClient::challengeName()} for help formatting this field.
39+
*/
40+
function verify_confidential_space_sample(string $formattedChallenge): void
41+
{
42+
// Create a client.
43+
$confidentialComputingClient = new ConfidentialComputingClient();
44+
45+
// Prepare the request message.
46+
$request = (new VerifyConfidentialSpaceRequest())
47+
->setChallenge($formattedChallenge);
48+
49+
// Call the API and handle any network failures.
50+
try {
51+
/** @var VerifyConfidentialSpaceResponse $response */
52+
$response = $confidentialComputingClient->verifyConfidentialSpace($request);
53+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
54+
} catch (ApiException $ex) {
55+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
56+
}
57+
}
58+
59+
/**
60+
* Helper to execute the sample.
61+
*
62+
* This sample has been automatically generated and should be regarded as a code
63+
* template only. It will require modifications to work:
64+
* - It may require correct/in-range values for request initialization.
65+
* - It may require specifying regional endpoints when creating the service client,
66+
* please see the apiEndpoint client configuration option for more details.
67+
*/
68+
function callSample(): void
69+
{
70+
$formattedChallenge = ConfidentialComputingClient::challengeName(
71+
'[PROJECT]',
72+
'[LOCATION]',
73+
'[UUID]'
74+
);
75+
76+
verify_confidential_space_sample($formattedChallenge);
77+
}
78+
// [END confidentialcomputing_v1_generated_ConfidentialComputing_VerifyConfidentialSpace_sync]

ConfidentialComputing/src/V1/AwsPrincipalTagsOptions.php

Lines changed: 77 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ConfidentialComputing/src/V1/AwsPrincipalTagsOptions/AllowedPrincipalTags.php

Lines changed: 79 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)