Google cloud firestore 使用Firestore数据库时,在Play Store上发布的应用程序的最佳规则是什么?

Google cloud firestore 使用Firestore数据库时,在Play Store上发布的应用程序的最佳规则是什么?,google-cloud-firestore,firebase-security,Google Cloud Firestore,Firebase Security,我将在Google Play Store上发布我的应用程序,但在测试阶段(Alpha版本),我使用了以下规则: rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { // This rule allows anyone on the internet to view, edit, and delete // all data in your Firesto

我将在Google Play Store上发布我的应用程序,但在测试阶段(Alpha版本),我使用了以下规则:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {

    // This rule allows anyone on the internet to view, edit, and delete
    // all data in your Firestore database. It is useful for getting
    // started, but it is configured to expire after 30 days because it
    // leaves your app open to attackers. At that time, all client
    // requests to your Firestore database will be denied.
    //
    // Make sure to write security rules for your app before that time, or else
    // your app will lose access to your Firestore database
    match /{document=**} {
     // allow read, write: if request.time < timestamp.date(2020, 3, 25);
     allow read, write: if request.auth.uid != null;
    }
  }
}
rules_version='2';
服务云.firestore{
匹配/databases/{database}/documents{
//此规则允许internet上的任何人查看、编辑和删除
//Firestore数据库中的所有数据。这对于获取
//已启动,但已配置为在30天后过期,因为
//使您的应用对攻击者开放。此时,所有客户端
//对Firestore数据库的请求将被拒绝。
//
//确保在此之前为你的应用编写安全规则,否则
//你的应用程序将无法访问你的Firestore数据库
匹配/{document=**}{
//允许读写:如果request.time
但是,当应用程序必须公开发布时,我不知道我的应用程序必须具备的最佳路径或最佳规则

我的应用程序有一个登录屏幕,在登录屏幕之后,每个用户都会在注册生成的文档中包含您的尊重文档和收藏


我想不出一个表单来保护我的invasors应用程序。

没有通用的“最佳规则”配置。如果不知道数据库中的数据以及您希望用户能够使用这些数据做什么,我们将无能为力。您需要花一些时间来学习如何使用规则语言,以及如何使用规则语言来指定谁可以对哪些文档执行哪些操作。从文档开始:除了Doug shared链接外,Firestore文档还包含一个示例,用于确保对应用程序用户“拥有”的数据的访问: