如何使用命令行部署Firebase数据库安全规则? [英] How do I deploy Firebase Database Security rules using the command line?

查看:208
本文介绍了如何使用命令行部署Firebase数据库安全规则?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在较旧版本的Firebase中,我们可以在 firebase.json 文件中添加规则部分,然后上传我们如何使用 firebase-tools v3命令行工具来部署每个部署的新安全规则。数据库安全规则?



此页表示可以这样做:Firebase存储规则

本页面提示命令行工具可以实现,但 firebase --help firebase部署 - 帮助似乎没有暗示如何做到这一点? (道歉,如果我错过了...)



(相关:哪里是所有可以进入 firebase.json ?我在旧的Firebase网站上找到了它,但无法通过搜索新文档找到它。)

谢谢!

解决方案您可以使用 firebase deploy --only database 如果您只想更新数据库规则。它会覆盖您现有的规则。



您可以查看 Firebase CLI参考资料了解更多信息


In older versions of Firebase, we could add a rules section to our firebase.json file, and upload new security rules on every deploy.

How do we use the firebase-tools v3 command-line tools to deploy database security rules?

This page says that it's possible: "Rules for Firebase Storage"

This page hints that the command line tools can do it, but firebase --help and firebase deploy --help don't seem to hint at how to do it? (Apologies if I missed it...)

(related: where is the canonical doc for everything that can go into firebase.json? I found it on the old Firebase site, but can't find it via search on the new docs.)

Thanks!

解决方案

You can use firebase deploy --only database if you only want to update database rules. It will overwrite your existing rules.

You can check out Firebase CLI Reference for more info

这篇关于如何使用命令行部署Firebase数据库安全规则?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆