Firestore limit reads and writes per hour or per day to prevent user setting a timer in the inspector

风格不统一 提交于 2020-06-06 07:57:28

问题


I am learning Firebase and I might use it in production. I can not find how to prevent a logged in user to edit javascript code and trigger thousands of reads per day automatically and that I will have to pay for. As far as I know, any user who would like to increase my firebase bill could set a timer by editing javascript code and read and write every 4 seconds where he can in the firestore database. How can you prevent a user read rate per day or hour?


回答1:


There is no way to set a read limit on Cloud Firestore.

You can implement a write limit in security rules as shown in this answer: How do I implement a write rate limit in Cloud Firestore security rules?. Alternatively you can pass all writes through Cloud Functions, where you can control the rate through your own code.

If you've set your security rules to limit users to the minimum data they need to be able to access, and think you're being abused, reach out to Firebase support for personalized help in troubleshooting.



来源:https://stackoverflow.com/questions/58895225/firestore-limit-reads-and-writes-per-hour-or-per-day-to-prevent-user-setting-a-t

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!