【问题标题】:Firebase: limited and secure service access from Pyrebase?Firebase:来自 Pyrebase 的有限且安全的服务访问?
【发布时间】:2016-08-23 10:07:18
【问题描述】:

使用 Firebase 的服务器 API 时,您可以提供额外的 databaseAuthVariableOverride 部分来限制对服务帐户的访问,如 in the docs 所述。我想使用Pyrebase,因为它在 python 中并且支持使用服务帐户。但是,如果我在那里使用服务帐户登录,它就可以完全访问数据库——写入前的验证规则不会被检查(虽然我确实希望它们被检查)。

所以,这个问题有两个部分:

  1. 是否可以在 Pyrebase 中添加对 databaseAuthVariableOverride 的支持?我看到它使用 Firebase REST API,但我不知道它是否支持它,以及我应该将那个变量发送到哪里。
  2. 我可以通过不使用服务帐户,而是将普通电子邮件/密码帐户设置为特定电子邮件,并添加根读/写规则检查auth.email === '<my-email> 和/或auth.uid === '<my-account-uid>' 来解决此问题。这里的问题是:这与使用访问受限的服务帐户(如顶部链接)一样安全吗?

【问题讨论】:

  • 如果您在 Pyrebase 存储库上发布功能请求,您可能会得到更好的响应 #1。

标签: python firebase firebase-realtime-database firebase-security


【解决方案1】:

您使用Authenticate with limited privileges 设置的auth.uid 和signing in with email&password 确定的auth.uid 之间的安全规则没有区别。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-12-30
    • 1970-01-01
    • 1970-01-01
    • 2015-06-21
    • 2019-04-15
    • 1970-01-01
    • 2013-04-04
    • 2021-04-10
    相关资源
    最近更新 更多