-
Notifications
You must be signed in to change notification settings - Fork 954
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
Authentication token property "firebase" not defined on test app's instance #2405
Comments
Assigning to @scottcrossen who is currently the on-call for Access. Scott do you know if the |
Hi! Can you initialize your test app like this instead? The reason is that the
|
Let me know if that works! |
Hello Scott, The documentation varies a bit from the actual implementation at this point. Therefore the confusion with the auth object from https://firebase.google.com/docs/rules/rules-and-auth. Maybe I could provide some suggestions to improve that part? Let me know. :) |
Sure! If you have any suggestions let me know and I'll pass it onto the person who does the documentation. I wish I could change the testing SDK to use the word "token" instead of "auth" in the object though: That would make this more clear. |
Many tutorials show only examples with Maybe a more detailed documentation about the A documentation of the actual object that A guideline for structuring the firestore rules and dos and don'ts could help especially beginners for getting a concrete idea of how a product ready setup could look like. Everything needs of course examples for a better understanding. I could provide some concrete ideas if I would know the format and the styleguides of the contributions to the docs. Of course I don't want to complain about anything with my suggestions. You guys do the best job outside there and your documentation and tutorials are by far the best I've ever seen 🥇. It's worth mentioning it. |
@malliaridis thank you so much for the detailed feedback! The good news is that we're currently cleaning up / repositioning The Sounds like we should:
|
@malliaridis I have referenced this discussion in our brand new |
@samtstern sorry for the late response. That's right. You pointed it out. I find very useful the tutorial Role based access, would be great if there would be more examples like this. Especially role based access is one of the most used access control strategies I think. |
@malliaridis (and anyone else following along here) this should be mostly addressed by this PR: In the next release of |
[REQUIRED] Environment info
firebase-tools: 8.4.1
Platform: Windows 10
[REQUIRED] Test case
Firestore rules file:
Test Suite:
[REQUIRED] Steps to reproduce
[REQUIRED] Expected behavior
The tests runned locally fail with false negative and with the error "Property firebase is undefined on object.". The same rules applied on the cloud rules succeed with the expected behavior.
[REQUIRED] Actual behavior
It is expected that the emulator's instance is mirroring the correct behavior like in the actual production environment. The property
firebase
should, since it was provided by the authentication objectauth
, be defined and not null. The object structure is copied from the browser tests that can be run directly when modifying the rules.Further Information
See https://groups.google.com/g/firebase-talk/c/g79uxsyOf3E/m/TvXnaqcjAwAJ
The text was updated successfully, but these errors were encountered: