diff --git a/bigquery/v2/bigquery-gen.go b/bigquery/v2/bigquery-gen.go index 258a44bd538..7b1247e21f7 100644 --- a/bigquery/v2/bigquery-gen.go +++ b/bigquery/v2/bigquery-gen.go @@ -145,7 +145,6 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) - opts = append(opts, internaloption.EnableNewAuthLibrary()) client, endpoint, err := htransport.NewClient(ctx, opts...) if err != nil { return nil, err diff --git a/compute/v0.alpha/compute-gen.go b/compute/v0.alpha/compute-gen.go index 4aed399d246..3c4ac294300 100644 --- a/compute/v0.alpha/compute-gen.go +++ b/compute/v0.alpha/compute-gen.go @@ -137,7 +137,6 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) - opts = append(opts, internaloption.EnableNewAuthLibrary()) client, endpoint, err := htransport.NewClient(ctx, opts...) if err != nil { return nil, err diff --git a/compute/v0.beta/compute-gen.go b/compute/v0.beta/compute-gen.go index 89e91dc78c1..23a0abfaf95 100644 --- a/compute/v0.beta/compute-gen.go +++ b/compute/v0.beta/compute-gen.go @@ -137,7 +137,6 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) - opts = append(opts, internaloption.EnableNewAuthLibrary()) client, endpoint, err := htransport.NewClient(ctx, opts...) if err != nil { return nil, err diff --git a/compute/v1/compute-gen.go b/compute/v1/compute-gen.go index e07038fe97f..29abc286d58 100644 --- a/compute/v1/compute-gen.go +++ b/compute/v1/compute-gen.go @@ -137,7 +137,6 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) - opts = append(opts, internaloption.EnableNewAuthLibrary()) client, endpoint, err := htransport.NewClient(ctx, opts...) if err != nil { return nil, err diff --git a/google-api-go-generator/gen.go b/google-api-go-generator/gen.go index 7fa66d717f3..06068115d9b 100644 --- a/google-api-go-generator/gen.go +++ b/google-api-go-generator/gen.go @@ -81,6 +81,15 @@ var skipAPIGeneration = map[string]bool{ "datalineage:v1": true, } +// skipNewAuthLibrary is a set of APIs to not migrate to cloud.google.com/go/auth. +var skipNewAuthLibrary = map[string]bool{ + "bigquery:v2": true, + "compute:alpha": true, + "compute:beta": true, + "compute:v1": true, + "storage:v1": true, +} + var apisToSplit = map[string]bool{ "compute": true, } @@ -888,8 +897,9 @@ func (a *API) GenerateCode() ([]byte, error) { if a.mtlsAPIBaseURL() != "" { pn("opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))") } - pn("opts = append(opts, internaloption.EnableNewAuthLibrary())") - + if !skipNewAuthLibrary[a.ID] { + pn("opts = append(opts, internaloption.EnableNewAuthLibrary())") + } pn("client, endpoint, err := htransport.NewClient(ctx, opts...)") pn("if err != nil { return nil, err }") pn("s, err := New(client)") diff --git a/storage/v1/storage-gen.go b/storage/v1/storage-gen.go index a6af8bd9ed3..07de6ebf63c 100644 --- a/storage/v1/storage-gen.go +++ b/storage/v1/storage-gen.go @@ -133,7 +133,6 @@ func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, err opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) - opts = append(opts, internaloption.EnableNewAuthLibrary()) client, endpoint, err := htransport.NewClient(ctx, opts...) if err != nil { return nil, err