Using client credentials with emulator #268
Labels
api: firestore
Issues related to the googleapis/python-firestore API.
priority: p1
Important issue which blocks shipping the next release. Will be fixed prior to next release.
🚨
This issue needs some love.
triage me
I really want to be triaged.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
If I create a custom token with:
https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyCustomToken?key=<key>
and then generate creds with this:
credentials.Credentials(token=token, scopes=_scopes)
I can then use these credentials to connect with a Firestore database and the database rules will be respected. I don't use this in production but is very useful for testing. But this doesn't work when testing against the emulator rather than a real db. Testing with the emulator is great but I have some tests that require the db rules to work. I can do this with a subclass of
firestore.Client
but it would be nice to have this in library.It can be done by changing the grpc.Channel used when connecting to the emulator so that it keeps the client._credentials rather than discarding them
I will submit a pull request for this shortly
Thanks
The text was updated successfully, but these errors were encountered: