有没有办法添加适用于Firebase中管理员的安全规则? [英] Is there a way to add security rules that apply to admin in Firebase?

查看:92
本文介绍了有没有办法添加适用于Firebase中管理员的安全规则?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道如何在管理服务器执行的写入操作中在Firebase中实施安全规则吗?

Does anyone know how to enforce security rules in Firebase on writes performed by the admin server?

例如:

userDetail:{ ".validate"://一些基于数据库引用的安全规则// }

userDetail: { ".validate" : //some security rule based on database reference// }

我想确保管理服务器的写操作遵守此验证规则.我知道可以在服务器本身上设置安全规则,但是我想确保数据与数据库中可以由其他服务器实例修改的另一个位置一致.

I want to ensure that a write by admin server adheres to this validation rule. I understand that a security rule can be put in place on the server itself, but I want to ensure that the data is consistent with another location in the database that can be modified by other server instances.

推荐答案

您不能编写适用于具有管理特权访问级别的请求的安全规则-这是服务帐户身份验证的默认设置.然后会完全禁用安全性,包括验证规则.

You cannot write security rules that apply to requests that have an administrative privileges access level – which is the default for service account authentication. Security is completely disabled then, including validation rules.

但这并不意味着您无法检查服务器.更改服务器以使用有限权限进行身份验证.在Node和Java中,关键字均为databaseAuthVariableOverride.

But this does not mean that you can't have your servers in check. Change the server to authenticate with limited privileges. In both Node and Java, the keyword is databaseAuthVariableOverride.

另请参见管理SDK设置文档.

这篇关于有没有办法添加适用于Firebase中管理员的安全规则?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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