Skip to content

Commit abc4da0

Browse files
authored
Merge pull request #216 from google/rest
Add REST-based verifier.Client
2 parents 1befe11 + a594f9a commit abc4da0

File tree

18 files changed

+327
-50
lines changed

18 files changed

+327
-50
lines changed

go.sum

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1235,7 +1235,6 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba
12351235
google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
12361236
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
12371237
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
1238-
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
12391238
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
12401239
google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw=
12411240
google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=

launcher/agent/agent_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import (
99

1010
"github.com/google/go-tpm-tools/client"
1111
"github.com/google/go-tpm-tools/internal/test"
12-
grpcclient "github.com/google/go-tpm-tools/launcher/verifier/grpc"
13-
"github.com/google/go-tpm-tools/launcher/verifier/grpc/service"
12+
"github.com/google/go-tpm-tools/launcher/verifier/grpcclient"
13+
"github.com/google/go-tpm-tools/launcher/verifier/grpcclient/service"
1414
"google.golang.org/grpc"
1515
"google.golang.org/grpc/credentials/insecure"
1616
"google.golang.org/grpc/test/bufconn"
1717

18-
servgrpc "github.com/google/go-tpm-tools/launcher/verifier/grpc/proto/attestation_verifier/v0"
18+
servgrpc "github.com/google/go-tpm-tools/launcher/verifier/grpcclient/proto/attestation_verifier/v0"
1919
)
2020

2121
func TestAttest(t *testing.T) {
@@ -41,8 +41,7 @@ func TestAttest(t *testing.T) {
4141
if err != nil {
4242
t.Fatalf("failed to connect to attestation service: %v", err)
4343
}
44-
pbClient := servgrpc.NewAttestationVerifierClient(conn)
45-
verifierClient := grpcclient.NewClient(pbClient, log.Default())
44+
verifierClient := grpcclient.NewClient(conn, log.Default())
4645
// Cannot test a GCE key on the simulator.
4746
agent := CreateAttestationAgent(tpm, client.AttestationKeyECC, verifierClient, placeholderFetcher)
4847

launcher/container_runner.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ import (
2323
"github.com/google/go-tpm-tools/client"
2424
"github.com/google/go-tpm-tools/launcher/agent"
2525
"github.com/google/go-tpm-tools/launcher/spec"
26-
grpcclient "github.com/google/go-tpm-tools/launcher/verifier/grpc"
27-
servpb "github.com/google/go-tpm-tools/launcher/verifier/grpc/proto/attestation_verifier/v0"
26+
"github.com/google/go-tpm-tools/launcher/verifier/grpcclient"
2827
v1 "github.com/opencontainers/image-spec/specs-go/v1"
2928
specs "github.com/opencontainers/runtime-spec/specs-go"
3029
"golang.org/x/oauth2"
@@ -168,8 +167,7 @@ func NewRunner(ctx context.Context, cdClient *containerd.Client, token oauth2.To
168167
if err != nil {
169168
return nil, fmt.Errorf("failed to open connection to attestation service: %v", err)
170169
}
171-
pbClient := servpb.NewAttestationVerifierClient(conn)
172-
verifierClient := grpcclient.NewClient(pbClient, logger)
170+
verifierClient := grpcclient.NewClient(conn, logger)
173171

174172
// Fetch ID token with specific audience.
175173
// See https://cloud.google.com/functions/docs/securing/authenticating#functions-bearer-token-example-go.

launcher/go.mod

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@ module github.com/google/go-tpm-tools/launcher
33
go 1.18
44

55
require (
6-
cloud.google.com/go/compute v1.5.0
6+
cloud.google.com/go/compute v1.7.0
77
cloud.google.com/go/logging v1.4.2
88
github.com/containerd/containerd v1.6.6
99
github.com/golang-jwt/jwt/v4 v4.4.1
10-
github.com/google/go-cmp v0.5.7
10+
github.com/google/go-cmp v0.5.8
1111
github.com/google/go-tpm v0.3.3
1212
github.com/google/go-tpm-tools v0.3.8
1313
github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799
1414
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417
15-
golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a
16-
google.golang.org/api v0.70.0
17-
google.golang.org/genproto v0.0.0-20220526192754-51939a95c655
18-
google.golang.org/grpc v1.46.2
15+
golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2
16+
google.golang.org/api v0.86.0
17+
google.golang.org/genproto v0.0.0-20220624142145-8cd45d7dbd1f
18+
google.golang.org/grpc v1.47.0
1919
google.golang.org/protobuf v1.28.0
2020
)
2121

2222
require (
23-
cloud.google.com/go v0.100.2 // indirect
23+
cloud.google.com/go v0.102.0 // indirect
2424
github.com/Microsoft/go-winio v0.5.2 // indirect
2525
github.com/Microsoft/hcsshim v0.9.3 // indirect
2626
github.com/containerd/cgroups v1.0.3 // indirect
@@ -37,7 +37,8 @@ require (
3737
github.com/google/go-attestation v0.4.4-0.20220404204839-8820d49b18d9 // indirect
3838
github.com/google/go-tspi v0.2.1-0.20190423175329-115dea689aad // indirect
3939
github.com/google/uuid v1.3.0 // indirect
40-
github.com/googleapis/gax-go/v2 v2.1.1 // indirect
40+
github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect
41+
github.com/googleapis/gax-go/v2 v2.4.0 // indirect
4142
github.com/klauspost/compress v1.15.5 // indirect
4243
github.com/moby/locker v1.0.1 // indirect
4344
github.com/moby/sys/mountinfo v0.6.1 // indirect
@@ -49,10 +50,12 @@ require (
4950
github.com/sirupsen/logrus v1.8.1 // indirect
5051
go.opencensus.io v0.23.0 // indirect
5152
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
52-
golang.org/x/net v0.0.0-20220526153639-5463443f8c37 // indirect
53-
golang.org/x/sync v0.0.0-20220513210516-0976fa681c29 // indirect
54-
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
53+
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect
54+
golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f // indirect
55+
golang.org/x/sys v0.0.0-20220624220833-87e55d714810 // indirect
5556
golang.org/x/text v0.3.7 // indirect
5657
google.golang.org/appengine v1.6.7 // indirect
5758
gopkg.in/yaml.v3 v3.0.0 // indirect
5859
)
60+
61+
replace google.golang.org/api v0.86.0 => github.com/josephlr/google-api-go-client v0.86.1

0 commit comments

Comments
 (0)