Saturday, 21 September 2019

Cloud Firestore security rules testing

We are developing an Android app based on Cloud Firestore.

Now, we have released the app to production and we continue to add more features, the changes force us to add/change the Firestore security rules.

The question is how to test the app with new security rules but before publishing the rules to all users?

I see in docs that Firestore has some emulator, but I don't understand if he can help or it used only for unit testing, there are also an simulator to test single request in draft mode, but in the end of the day we need to test the functionality of the app manually.

In other words, is there a way to change the security rules and test the app before apply it to all users?

Also i have some question to those who using Firebase in production:

  1. I guess database your splited for development and production, do you split it in same project or create 2 projects with 2 google-services.json files, if you using in same project how do you handle changes in security rules for both versions?
  2. There may be changes between the app releases and data structures, but there are only one version of rules, some rules will be not compatible with another app releases, how do you handle this situation?

Maybe i missing something important about Firestore.

Thanks in advance.



from Cloud Firestore security rules testing

No comments:

Post a Comment