【问题标题】:User RemoteConfig with Firebase Database Rules使用 Firebase 数据库规则的用户 RemoteConfig
【发布时间】:2017-06-25 01:49:09
【问题描述】:

有没有办法通过数据库规则访问 remoteconfig?这样我就可以设置一个 .validate 规则?喜欢

remote config: max_username_length = 10,那么规则中是否存在类似的东西?

".validate":"remoteConfig.max_username_length > newData.val()"

或者类似的?

【问题讨论】:

    标签: firebase firebase-realtime-database firebase-security firebase-remote-config


    【解决方案1】:

    firebaser 在这里

    目前无法从 Firebase 数据库安全规则访问远程配置变量。

    Remote Config 用于将配置数据推送到每个客户端,同时在服务器上评估安全性。所以我没有立即看到如何/为什么允许这样的连接。

    如果您希望在数据库安全规则中使用特定于用户的配置数据,将配置数据保存在数据库本身中会更容易。例如

    userConfig
      $uid
        config1: "value1"
        config1: true
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-12-29
      • 2017-07-15
      • 2019-01-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多