jeudi 18 mars 2021

FirebaseFirestore - is there a rule or a way to authorize only my web app to read from database?

So I created web app which should propagate the products, meaning there will be catalog with pictures of products. This means that there will be bunch of pictures which I'm storing in Storage and reference those pictures by Firestore database.

Now, I already configured to deny any write so no one can mess with my data, but I'm a bit worried about read, even though I have no sensitive data there, but showing pictures from my Storage will use my data, so I was wondering if there is any way, doesn't need to be rules per-se, but some way to restrict database read only from my domain.

Since this is just catalog web app, making login restriction makes no sense, since I want anyone who visits to see everything.

As a matter of fact, can I just add firebase configuration in a file, which I will reference in index.html and read it from there? Will this approach also expose the configuration in inspect element on browser?




Aucun commentaire:

Enregistrer un commentaire