Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using client credentials with emulator #268

Closed
paulharter opened this issue Dec 9, 2020 · 1 comment
Closed

Using client credentials with emulator #268

paulharter opened this issue Dec 9, 2020 · 1 comment
Assignees
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.

Comments

@paulharter
Copy link
Contributor

paulharter commented Dec 9, 2020

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

@product-auto-label product-auto-label bot added the api: firestore Issues related to the googleapis/python-firestore API. label Dec 9, 2020
@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Dec 10, 2020
@crwilcox crwilcox added priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Dec 15, 2020
@crwilcox
Copy link
Contributor

merged feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

3 participants