Skip to content

identitytoolkit: panic when http.DefaultTransport is not a *http.Transport instance  #10159

@Azuka

Description

@Azuka

Client

identitytoolkit

Environment

Google Cloud Functions

Go Environment

$ go version: 1.22.3
$ go env

Code

e.g.

http.DefaultTransport = otelhttp.NewTransport(&http.Transport{...})

identityClient, err := identitytoolkit.NewService(
		ctx,
		option.WithAPIKey(cfg.FirebaseAPIKey),
		option.WithGRPCDialOption(
			grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
		),
	)

Expected behavior

Construction does not panic

Actual behavior

Panic

Screenshots

Additional context

Modifying the global http.DefaultTransport (e.g. to wrap an opentelemetry http roundtripper with new defaults) results in a panic when the client constructor tries to clone an expected *http.Transport. Is there a way to bypass the call when using grpc?

https://github.com/googleapis/google-cloud-go/blame/main/auth/httptransport/transport.go#L97

Also related: golang/go#39299

Metadata

Metadata

Assignees

Labels

api: identitytoolkitIssues related to the Identity Platform API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions