Closed anuraaga closed 2 months ago
Although this is a little different I think this is similar enough to https://github.com/googleapis/google-api-go-client/issues/2623 which both touch on this behaviour. As of right now I don't think we will be changing this behaviour but will leave the issue open for discussion. If we were to make a change like this more testing would need to take place, which the other issue mentions.
Is your feature request related to a problem? Please describe.
I would like to unit test some code using identitytoolkit to create tenants against the Firebase auth emulator, but currently it doesn't seem to be possible. The emulator exposes identitytoolkit at URLs such as
http://localhost:60304/identitytoolkit.googleapis.com/v2/projects/test/tenants
If I try to initialize identity toolkit with this endpoint,
gcpIdentity, err := identitytoolkit.NewService(ctx, option.WithEndpoint("https://localhost:60304/identitytoolkit.googleapis.com"))
it still sends requests to
/v2
, not to/identitytoolkit.googleapis.com/v2
. This is because any path components from endpoint are stripped all the time.https://github.com/googleapis/google-api-go-client/blob/main/identitytoolkit/v2/identitytoolkit-gen.go#L6186 https://github.com/googleapis/google-api-go-client/blob/711eb913fe455ffe5c9d717b44762801820c0e8c/googleapi/googleapi.go#L302
Describe the solution you'd like A clear and concise description of what you want to happen.
I'm not too sure the motivation of stripping paths opaquely since all default endpoints should be valid without stripping, and otherwise the user is providing a value that seems like it should be respected. So the simplest would be to not strip out path from endpoint.
If it's a breaking change, then perhaps an option to force keeping the path.
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Natively handling the same env var
FIREBASE_AUTH_EMULATOR_HOST
as the firebase admin SDK. But as this is generated code, it seems not reasonable to have identitytoolkit-specific logic in it.Additional context Add any other context or screenshots about the feature request here.