Skip to content

Commit cb89cdd

Browse files
authored
chore(revert): Revert "chore: [google-cloud-confidentialcomputing] Update gapic-generator-python to 1.26.2"" (#14359)
Reverts #14356 BEGIN_COMMIT_OVERRIDE 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 END_COMMIT_OVERRIDE ~Wait for discussion in b/421423826~
1 parent fed2e38 commit cb89cdd

20 files changed

+3739
-505
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,29 +25,39 @@
2525
ConfidentialComputingClient,
2626
)
2727
from google.cloud.confidentialcomputing_v1.types.service import (
28+
AwsPrincipalTagsOptions,
2829
Challenge,
2930
ConfidentialSpaceInfo,
3031
ContainerImageSignature,
3132
CreateChallengeRequest,
33+
GceShieldedIdentity,
3234
GcpCredentials,
3335
SevSnpAttestation,
36+
SignatureType,
3437
SignedEntity,
3538
SigningAlgorithm,
3639
TdxCcelAttestation,
3740
TokenOptions,
41+
TokenProfile,
3842
TokenType,
3943
TpmAttestation,
4044
VerifyAttestationRequest,
4145
VerifyAttestationResponse,
46+
VerifyConfidentialGkeRequest,
47+
VerifyConfidentialGkeResponse,
48+
VerifyConfidentialSpaceRequest,
49+
VerifyConfidentialSpaceResponse,
4250
)
4351

4452
__all__ = (
4553
"ConfidentialComputingClient",
4654
"ConfidentialComputingAsyncClient",
55+
"AwsPrincipalTagsOptions",
4756
"Challenge",
4857
"ConfidentialSpaceInfo",
4958
"ContainerImageSignature",
5059
"CreateChallengeRequest",
60+
"GceShieldedIdentity",
5161
"GcpCredentials",
5262
"SevSnpAttestation",
5363
"SignedEntity",
@@ -56,6 +66,12 @@
5666
"TpmAttestation",
5767
"VerifyAttestationRequest",
5868
"VerifyAttestationResponse",
69+
"VerifyConfidentialGkeRequest",
70+
"VerifyConfidentialGkeResponse",
71+
"VerifyConfidentialSpaceRequest",
72+
"VerifyConfidentialSpaceResponse",
73+
"SignatureType",
5974
"SigningAlgorithm",
75+
"TokenProfile",
6076
"TokenType",
6177
)

packages/google-cloud-confidentialcomputing/google/cloud/confidentialcomputing_v1/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,37 +23,53 @@
2323
ConfidentialComputingClient,
2424
)
2525
from .types.service import (
26+
AwsPrincipalTagsOptions,
2627
Challenge,
2728
ConfidentialSpaceInfo,
2829
ContainerImageSignature,
2930
CreateChallengeRequest,
31+
GceShieldedIdentity,
3032
GcpCredentials,
3133
SevSnpAttestation,
34+
SignatureType,
3235
SignedEntity,
3336
SigningAlgorithm,
3437
TdxCcelAttestation,
3538
TokenOptions,
39+
TokenProfile,
3640
TokenType,
3741
TpmAttestation,
3842
VerifyAttestationRequest,
3943
VerifyAttestationResponse,
44+
VerifyConfidentialGkeRequest,
45+
VerifyConfidentialGkeResponse,
46+
VerifyConfidentialSpaceRequest,
47+
VerifyConfidentialSpaceResponse,
4048
)
4149

4250
__all__ = (
4351
"ConfidentialComputingAsyncClient",
52+
"AwsPrincipalTagsOptions",
4453
"Challenge",
4554
"ConfidentialComputingClient",
4655
"ConfidentialSpaceInfo",
4756
"ContainerImageSignature",
4857
"CreateChallengeRequest",
58+
"GceShieldedIdentity",
4959
"GcpCredentials",
5060
"SevSnpAttestation",
61+
"SignatureType",
5162
"SignedEntity",
5263
"SigningAlgorithm",
5364
"TdxCcelAttestation",
5465
"TokenOptions",
66+
"TokenProfile",
5567
"TokenType",
5668
"TpmAttestation",
5769
"VerifyAttestationRequest",
5870
"VerifyAttestationResponse",
71+
"VerifyConfidentialGkeRequest",
72+
"VerifyConfidentialGkeResponse",
73+
"VerifyConfidentialSpaceRequest",
74+
"VerifyConfidentialSpaceResponse",
5975
)

packages/google-cloud-confidentialcomputing/google/cloud/confidentialcomputing_v1/gapic_metadata.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@
1919
"methods": [
2020
"verify_attestation"
2121
]
22+
},
23+
"VerifyConfidentialGke": {
24+
"methods": [
25+
"verify_confidential_gke"
26+
]
27+
},
28+
"VerifyConfidentialSpace": {
29+
"methods": [
30+
"verify_confidential_space"
31+
]
2232
}
2333
}
2434
},
@@ -34,6 +44,16 @@
3444
"methods": [
3545
"verify_attestation"
3646
]
47+
},
48+
"VerifyConfidentialGke": {
49+
"methods": [
50+
"verify_confidential_gke"
51+
]
52+
},
53+
"VerifyConfidentialSpace": {
54+
"methods": [
55+
"verify_confidential_space"
56+
]
3757
}
3858
}
3959
},
@@ -49,6 +69,16 @@
4969
"methods": [
5070
"verify_attestation"
5171
]
72+
},
73+
"VerifyConfidentialGke": {
74+
"methods": [
75+
"verify_confidential_gke"
76+
]
77+
},
78+
"VerifyConfidentialSpace": {
79+
"methods": [
80+
"verify_confidential_space"
81+
]
5282
}
5383
}
5484
}

packages/google-cloud-confidentialcomputing/google/cloud/confidentialcomputing_v1/services/confidential_computing/async_client.py

Lines changed: 191 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ async def verify_attestation(
431431
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
432432
) -> service.VerifyAttestationResponse:
433433
r"""Verifies the provided attestation info, returning a
434-
signed OIDC token.
434+
signed attestation token.
435435
436436
.. code-block:: python
437437
@@ -461,7 +461,7 @@ async def sample_verify_attestation():
461461
462462
Args:
463463
request (Optional[Union[google.cloud.confidentialcomputing_v1.types.VerifyAttestationRequest, dict]]):
464-
The request object. A request for an OIDC token,
464+
The request object. A request for an attestation token,
465465
providing all the necessary information
466466
needed for this service to verify the
467467
platform state of the requestor.
@@ -477,7 +477,7 @@ async def sample_verify_attestation():
477477
google.cloud.confidentialcomputing_v1.types.VerifyAttestationResponse:
478478
A response once an attestation has
479479
been successfully verified, containing a
480-
signed OIDC token.
480+
signed attestation token.
481481
482482
"""
483483
# Create or coerce a protobuf request object.
@@ -514,6 +514,194 @@ async def sample_verify_attestation():
514514
# Done; return the response.
515515
return response
516516

517+
async def verify_confidential_space(
518+
self,
519+
request: Optional[Union[service.VerifyConfidentialSpaceRequest, dict]] = None,
520+
*,
521+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
522+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
523+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
524+
) -> service.VerifyConfidentialSpaceResponse:
525+
r"""Verifies whether the provided attestation info is
526+
valid, returning a signed attestation token if so.
527+
528+
.. code-block:: python
529+
530+
# This snippet has been automatically generated and should be regarded as a
531+
# code template only.
532+
# It will require modifications to work:
533+
# - It may require correct/in-range values for request initialization.
534+
# - It may require specifying regional endpoints when creating the service
535+
# client as shown in:
536+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
537+
from google.cloud import confidentialcomputing_v1
538+
539+
async def sample_verify_confidential_space():
540+
# Create a client
541+
client = confidentialcomputing_v1.ConfidentialComputingAsyncClient()
542+
543+
# Initialize request argument(s)
544+
request = confidentialcomputing_v1.VerifyConfidentialSpaceRequest(
545+
challenge="challenge_value",
546+
)
547+
548+
# Make the request
549+
response = await client.verify_confidential_space(request=request)
550+
551+
# Handle the response
552+
print(response)
553+
554+
Args:
555+
request (Optional[Union[google.cloud.confidentialcomputing_v1.types.VerifyConfidentialSpaceRequest, dict]]):
556+
The request object. A request for an attestation token,
557+
providing all the necessary information
558+
needed for this service to verify the
559+
platform state of the requestor.
560+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
561+
should be retried.
562+
timeout (float): The timeout for this request.
563+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
564+
sent along with the request as metadata. Normally, each value must be of type `str`,
565+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
566+
be of type `bytes`.
567+
568+
Returns:
569+
google.cloud.confidentialcomputing_v1.types.VerifyConfidentialSpaceResponse:
570+
VerifyConfidentialSpaceResponse is
571+
returned once a Confidential Space
572+
attestation has been successfully
573+
verified, containing a signed token.
574+
575+
"""
576+
# Create or coerce a protobuf request object.
577+
# - Use the request object if provided (there's no risk of modifying the input as
578+
# there are no flattened fields), or create one.
579+
if not isinstance(request, service.VerifyConfidentialSpaceRequest):
580+
request = service.VerifyConfidentialSpaceRequest(request)
581+
582+
# Wrap the RPC method; this adds retry and timeout information,
583+
# and friendly error handling.
584+
rpc = self._client._transport._wrapped_methods[
585+
self._client._transport.verify_confidential_space
586+
]
587+
588+
# Certain fields should be provided within the metadata header;
589+
# add these here.
590+
metadata = tuple(metadata) + (
591+
gapic_v1.routing_header.to_grpc_metadata(
592+
(("challenge", request.challenge),)
593+
),
594+
)
595+
596+
# Validate the universe domain.
597+
self._client._validate_universe_domain()
598+
599+
# Send the request.
600+
response = await rpc(
601+
request,
602+
retry=retry,
603+
timeout=timeout,
604+
metadata=metadata,
605+
)
606+
607+
# Done; return the response.
608+
return response
609+
610+
async def verify_confidential_gke(
611+
self,
612+
request: Optional[Union[service.VerifyConfidentialGkeRequest, dict]] = None,
613+
*,
614+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
615+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
616+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
617+
) -> service.VerifyConfidentialGkeResponse:
618+
r"""Verifies the provided Confidential GKE attestation
619+
info, returning a signed OIDC token.
620+
621+
.. code-block:: python
622+
623+
# This snippet has been automatically generated and should be regarded as a
624+
# code template only.
625+
# It will require modifications to work:
626+
# - It may require correct/in-range values for request initialization.
627+
# - It may require specifying regional endpoints when creating the service
628+
# client as shown in:
629+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
630+
from google.cloud import confidentialcomputing_v1
631+
632+
async def sample_verify_confidential_gke():
633+
# Create a client
634+
client = confidentialcomputing_v1.ConfidentialComputingAsyncClient()
635+
636+
# Initialize request argument(s)
637+
request = confidentialcomputing_v1.VerifyConfidentialGkeRequest(
638+
challenge="challenge_value",
639+
)
640+
641+
# Make the request
642+
response = await client.verify_confidential_gke(request=request)
643+
644+
# Handle the response
645+
print(response)
646+
647+
Args:
648+
request (Optional[Union[google.cloud.confidentialcomputing_v1.types.VerifyConfidentialGkeRequest, dict]]):
649+
The request object. A request for an attestation token,
650+
providing all the necessary information
651+
needed for this service to verify
652+
Confidential GKE platform state of the
653+
requestor.
654+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
655+
should be retried.
656+
timeout (float): The timeout for this request.
657+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
658+
sent along with the request as metadata. Normally, each value must be of type `str`,
659+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
660+
be of type `bytes`.
661+
662+
Returns:
663+
google.cloud.confidentialcomputing_v1.types.VerifyConfidentialGkeResponse:
664+
VerifyConfidentialGkeResponse
665+
response is returened once a
666+
Confidential GKE attestation has been
667+
successfully verified, containing a
668+
signed OIDC token.
669+
670+
"""
671+
# Create or coerce a protobuf request object.
672+
# - Use the request object if provided (there's no risk of modifying the input as
673+
# there are no flattened fields), or create one.
674+
if not isinstance(request, service.VerifyConfidentialGkeRequest):
675+
request = service.VerifyConfidentialGkeRequest(request)
676+
677+
# Wrap the RPC method; this adds retry and timeout information,
678+
# and friendly error handling.
679+
rpc = self._client._transport._wrapped_methods[
680+
self._client._transport.verify_confidential_gke
681+
]
682+
683+
# Certain fields should be provided within the metadata header;
684+
# add these here.
685+
metadata = tuple(metadata) + (
686+
gapic_v1.routing_header.to_grpc_metadata(
687+
(("challenge", request.challenge),)
688+
),
689+
)
690+
691+
# Validate the universe domain.
692+
self._client._validate_universe_domain()
693+
694+
# Send the request.
695+
response = await rpc(
696+
request,
697+
retry=retry,
698+
timeout=timeout,
699+
metadata=metadata,
700+
)
701+
702+
# Done; return the response.
703+
return response
704+
517705
async def get_location(
518706
self,
519707
request: Optional[locations_pb2.GetLocationRequest] = None,

0 commit comments

Comments
 (0)