Firebase数据库在线编辑器是否忽略安全规则? [英] does the firebase database online editor ignore security rules

查看:145
本文介绍了Firebase数据库在线编辑器是否忽略安全规则?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有规则设置,以确保一个外键像约束:当我把数据放在一个特定的路径,密钥被验证存在于另一个节点。

规则片段:

 app:{
freebies:{
$ provider_id:{
.validate:newData.parent()。parent()。parent()。child('app')。child('提供者')。child($ provider_id).val()!= null

}




如果我用这些参数运行模拟
$ b $写入 / app / freebies
width data: {totally_fake:1}



这失败了,这是正确的。另一方面,如果我只是去在线编辑器,并用相同的数据添加一个节点到相同的位置,它写无误的数据库即可。



我的问题是:在线编辑器是否绕过了安全规则?

解决方案

是的,它的确如此。 Firebase控制台以及Admin SDK绕过了安全规则,并具有对实时数据库的管理访问权。


I have rules set up that ensure a foreign key like constraint: when I put data at a certain path, the key is validated to exist at another node.

Rule snippet:

"app": {
  "freebies": {
     "$provider_id": {
          ".validate": "newData.parent().parent().parent().child('app').child('providers').child($provider_id).val() != null"
        }
      }

}

If I run a simulation with these params

Write to /app/freebies width data: {"totally_fake": 1}

This fails, which is CORRECT.

On the other hand, if I just go to the online editor and add a node to the same location with the same data, it writes the DB without errors.

My question is: does the online editor bypass the security rules ?

解决方案

Yes, it does. The Firebase console, as well as the Admin SDKs, bypass security rules and have "administrative" access to the Realtime Database.

这篇关于Firebase数据库在线编辑器是否忽略安全规则?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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