Firebase安全规则:“规则使用旧版本”,什么是当前版本?

问题描述 投票:0回答:1

firebase --version 8.4.1

使用Firebase初始化,我创建了一些文件。

现在,firebase部署正在抱怨firebase.storage。错误消息是:

规则集使用旧版本(版本[1])。请更新为最新版本(版本[2])。

这怎么了?

firebase deploy
deploying database, storage, firestore, functions, hosting 
database:   checking rules syntax... 
database: rules syntax for database $db is valid 
firebase.storage: checking storage.rules for compilation errors... 
undefined:undefined - Ruleset uses old version (version
   [1]). Please update to the latest version (version [2]).
firebase.storage: rules file storage.rules compiled successfully

cat storage.rules

service firebase.storage {
  match /b/{bucket}/o {
    match /{allPaths=**} {
      allow read, write: if request.auth!=null;
    }
  }
}
firebase firebase-storage firebase-security firebase-cli
1个回答
0
投票

您应该继续使用security rules version 2。注意第一行:

rules_version = '2';
service firebase.storage {
  match /b/{bucket}/o {
    match /{allPaths=**} {
      allow read, write: if request.auth!=null;
    }
  }
}
© www.soinside.com 2019 - 2024. All rights reserved.