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

gapic: support EnableJwtWithScope for gRPC GAPIC clients #674

Merged
merged 4 commits into from Jun 23, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions internal/gengapic/gengrpc.go
Expand Up @@ -198,6 +198,7 @@ func (g *generator) grpcClientOptions(serv *descriptor.ServiceDescriptorProto, s
p(" internaloption.WithDefaultMTLSEndpoint(%q),", generateDefaultMTLSEndpoint(host))
p(" internaloption.WithDefaultAudience(%q),", generateDefaultAudience(host))
p(" internaloption.WithDefaultScopes(DefaultAuthScopes()...),")
p(" internaloption.EnableJwtWithScope(),")
p(" option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),")
p(" option.WithGRPCDialOption(grpc.WithDefaultCallOptions(")
p(" grpc.MaxCallRecvMsgSize(math.MaxInt32))),")
Expand Down
1 change: 1 addition & 0 deletions internal/gengapic/testdata/empty_opt.want
Expand Up @@ -21,6 +21,7 @@ func defaultGRPCClientOptions() []option.ClientOption {
internaloption.WithDefaultMTLSEndpoint("foo.mtls.googleapis.com:443"),
internaloption.WithDefaultAudience("https://foo.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
internaloption.EnableJwtWithScope(),
option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
Expand Down
1 change: 1 addition & 0 deletions internal/gengapic/testdata/foo_opt.want
Expand Up @@ -21,6 +21,7 @@ func defaultFooGRPCClientOptions() []option.ClientOption {
internaloption.WithDefaultMTLSEndpoint("foo.mtls.googleapis.com:443"),
internaloption.WithDefaultAudience("https://foo.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
internaloption.EnableJwtWithScope(),
option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
Expand Down
1 change: 1 addition & 0 deletions internal/gengapic/testdata/host_port_opt.want
Expand Up @@ -19,6 +19,7 @@ func defaultBarGRPCClientOptions() []option.ClientOption {
internaloption.WithDefaultMTLSEndpoint("foo.mtls.googleapis.com:1234"),
internaloption.WithDefaultAudience("https://foo.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
internaloption.EnableJwtWithScope(),
option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
Expand Down
1 change: 1 addition & 0 deletions internal/gengapic/testdata/iam_override_opt.want
Expand Up @@ -18,6 +18,7 @@ func defaultBazGRPCClientOptions() []option.ClientOption {
internaloption.WithDefaultMTLSEndpoint("foo.mtls.googleapis.com:1234"),
internaloption.WithDefaultAudience("https://foo.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
internaloption.EnableJwtWithScope(),
option.WithGRPCDialOption(grpc.WithDisableServiceConfig()),
option.WithGRPCDialOption(grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt32))),
Expand Down
2 changes: 1 addition & 1 deletion showcase/go.mod
Expand Up @@ -6,7 +6,7 @@ require (
github.com/google/go-cmp v0.5.5
github.com/googleapis/gapic-showcase v0.15.0
github.com/googleapis/gax-go/v2 v2.0.5
google.golang.org/api v0.46.0
google.golang.org/api v0.49.0
google.golang.org/genproto v0.0.0-20210506142907-4a47615972c2
google.golang.org/grpc v1.37.0
google.golang.org/protobuf v1.26.0
Expand Down