Skip to content

Using client credentials with emulator #268

@paulharter

Description

@paulharter

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

Metadata

Metadata

Assignees

Labels

🚨This issue needs some love.api: firestoreIssues related to the googleapis/python-firestore API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.triage meI really want to be triaged.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions