Firebase 安全规则:"ruleset uses old version",当前版本是多少?
Firebase security rules: "ruleset uses old version", what is current version?
firebase --版本 8.4.1
我使用 Firebase init 创建了一些文件。
现在 firebase 部署正在抱怨 firebase.storage。错误信息是:
Ruleset uses old version (version [1]). Please update to the latest version (version [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;
}
}
}
您以后应该使用 security rules version 2。注意第一行:
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if request.auth!=null;
}
}
}
firebase --版本 8.4.1
我使用 Firebase init 创建了一些文件。
现在 firebase 部署正在抱怨 firebase.storage。错误信息是:
Ruleset uses old version (version [1]). Please update to the latest version (version [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;
}
}
}
您以后应该使用 security rules version 2。注意第一行:
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if request.auth!=null;
}
}
}