Skip to content

Commit

Permalink
feat: [confidentialcomputing] Added support for signed container imag…
Browse files Browse the repository at this point in the history
…e and custom audience and nonce requests (#9701)

* feat: Added support for signed container image and custom audience and nonce requests

New fields have been incorporated into the VerifyAttestationRequest proto message to accommodate two additional features: signed container image and custom audience and nonce.

PiperOrigin-RevId: 551026956

Source-Link: googleapis/googleapis@a31b53e

Source-Link: googleapis/googleapis-gen@640cd43
Copy-Tag: eyJwIjoiamF2YS1jb25maWRlbnRpYWxjb21wdXRpbmcvLk93bEJvdC55YW1sIiwiaCI6IjY0MGNkNDM0ZmMzYjQ2OWJiYzIzNmZjNGQ1MjUxYjY5NmIxODAxYjYifQ==

* 🦉 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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Aug 2, 2023
1 parent 4659951 commit c5c0b87
Show file tree
Hide file tree
Showing 20 changed files with 5,541 additions and 39 deletions.
2 changes: 1 addition & 1 deletion java-confidentialcomputing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-confidentialcomputing/java11.html
[stability-image]: https://img.shields.io/badge/stability-preview-yellow
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-confidentialcomputing.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-confidentialcomputing/0.7.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-confidentialcomputing/0.8.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ public final UnaryCallable<CreateChallengeRequest, Challenge> createChallengeCal
* .setChallenge(ChallengeName.of("[PROJECT]", "[LOCATION]", "[UUID]").toString())
* .setGcpCredentials(GcpCredentials.newBuilder().build())
* .setTpmAttestation(TpmAttestation.newBuilder().build())
* .setConfidentialSpaceInfo(ConfidentialSpaceInfo.newBuilder().build())
* .setTokenOptions(TokenOptions.newBuilder().build())
* .build();
* VerifyAttestationResponse response = confidentialComputingClient.verifyAttestation(request);
* }
Expand Down Expand Up @@ -358,6 +360,8 @@ public final VerifyAttestationResponse verifyAttestation(VerifyAttestationReques
* .setChallenge(ChallengeName.of("[PROJECT]", "[LOCATION]", "[UUID]").toString())
* .setGcpCredentials(GcpCredentials.newBuilder().build())
* .setTpmAttestation(TpmAttestation.newBuilder().build())
* .setConfidentialSpaceInfo(ConfidentialSpaceInfo.newBuilder().build())
* .setTokenOptions(TokenOptions.newBuilder().build())
* .build();
* ApiFuture<VerifyAttestationResponse> future =
* confidentialComputingClient.verifyAttestationCallable().futureCall(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,42 @@
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.cloud.confidentialcomputing.v1.ConfidentialSpaceInfo$Builder",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.cloud.confidentialcomputing.v1.ContainerImageSignature",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.cloud.confidentialcomputing.v1.ContainerImageSignature$Builder",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.cloud.confidentialcomputing.v1.CreateChallengeRequest",
"queryAllDeclaredConstructors": true,
Expand Down Expand Up @@ -431,6 +467,51 @@
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.cloud.confidentialcomputing.v1.SignedEntity",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.cloud.confidentialcomputing.v1.SignedEntity$Builder",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.cloud.confidentialcomputing.v1.SigningAlgorithm",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.cloud.confidentialcomputing.v1.TokenOptions",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.cloud.confidentialcomputing.v1.TokenOptions$Builder",
"queryAllDeclaredConstructors": true,
"queryAllPublicConstructors": true,
"queryAllDeclaredMethods": true,
"allPublicMethods": true,
"allDeclaredClasses": true,
"allPublicClasses": true
},
{
"name": "com.google.cloud.confidentialcomputing.v1.TpmAttestation",
"queryAllDeclaredConstructors": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ public void verifyAttestationTest() throws Exception {
.setChallenge(ChallengeName.of("[PROJECT]", "[LOCATION]", "[UUID]").toString())
.setGcpCredentials(GcpCredentials.newBuilder().build())
.setTpmAttestation(TpmAttestation.newBuilder().build())
.setConfidentialSpaceInfo(ConfidentialSpaceInfo.newBuilder().build())
.setTokenOptions(TokenOptions.newBuilder().build())
.build();

VerifyAttestationResponse actualResponse = client.verifyAttestation(request);
Expand Down Expand Up @@ -228,6 +230,8 @@ public void verifyAttestationExceptionTest() throws Exception {
.setChallenge(ChallengeName.of("[PROJECT]", "[LOCATION]", "[UUID]").toString())
.setGcpCredentials(GcpCredentials.newBuilder().build())
.setTpmAttestation(TpmAttestation.newBuilder().build())
.setConfidentialSpaceInfo(ConfidentialSpaceInfo.newBuilder().build())
.setTokenOptions(TokenOptions.newBuilder().build())
.build();
client.verifyAttestation(request);
Assert.fail("No exception raised");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ public void verifyAttestationTest() throws Exception {
.setChallenge(ChallengeName.of("[PROJECT]", "[LOCATION]", "[UUID]").toString())
.setGcpCredentials(GcpCredentials.newBuilder().build())
.setTpmAttestation(TpmAttestation.newBuilder().build())
.setConfidentialSpaceInfo(ConfidentialSpaceInfo.newBuilder().build())
.setTokenOptions(TokenOptions.newBuilder().build())
.build();

VerifyAttestationResponse actualResponse = client.verifyAttestation(request);
Expand All @@ -203,6 +205,9 @@ public void verifyAttestationTest() throws Exception {
Assert.assertEquals(request.getChallenge(), actualRequest.getChallenge());
Assert.assertEquals(request.getGcpCredentials(), actualRequest.getGcpCredentials());
Assert.assertEquals(request.getTpmAttestation(), actualRequest.getTpmAttestation());
Assert.assertEquals(
request.getConfidentialSpaceInfo(), actualRequest.getConfidentialSpaceInfo());
Assert.assertEquals(request.getTokenOptions(), actualRequest.getTokenOptions());
Assert.assertTrue(
channelProvider.isHeaderSent(
ApiClientHeaderProvider.getDefaultApiClientHeaderKey(),
Expand All @@ -220,6 +225,8 @@ public void verifyAttestationExceptionTest() throws Exception {
.setChallenge(ChallengeName.of("[PROJECT]", "[LOCATION]", "[UUID]").toString())
.setGcpCredentials(GcpCredentials.newBuilder().build())
.setTpmAttestation(TpmAttestation.newBuilder().build())
.setConfidentialSpaceInfo(ConfidentialSpaceInfo.newBuilder().build())
.setTokenOptions(TokenOptions.newBuilder().build())
.build();
client.verifyAttestation(request);
Assert.fail("No exception raised");
Expand Down
Loading

0 comments on commit c5c0b87

Please sign in to comment.