Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [confidentialcomputing] Added support for signed container image and custom audience and nonce requests #9701

Merged
merged 2 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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