Ability to access firebase auth emulator with identitytoolkit #2668
Labels
priority: p3
Desirable enhancement or fix. May not be included in next release.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
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
google-api-go-client/googleapi/googleapi.go
Line 302 in 711eb91
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.
The text was updated successfully, but these errors were encountered: