【问题标题】:What are different types of match in Firebase Storage Security Rules? [closed]Firebase 存储安全规则中有哪些不同类型的匹配? [关闭]
【发布时间】:2019-06-15 09:09:01
【问题描述】:

Firebase 存储安全规则中有哪些不同类型的匹配? 如何匹配安全规则中的路径似乎非常令人困惑。 请帮忙。谢谢!

【问题讨论】:

    标签: firebase firebase-realtime-database firebase-authentication firebase-storage firebase-security


    【解决方案1】:

    在 Firebase 存储安全规则中,"match" 是关键字。 "match" 用于匹配特定的存储路径,以便您可以将规则应用于该位置。每条路径都以'/' 开头,后跟路径段。

    路径段有 3 种类型:

    1. 单段:对特定文件的引用。语法 - match /images/profile.png(仅匹配 /images/profile.png)
    2. 单段通配符:引用特定路径级别的所有路径。语法 - match /images/{images} (匹配 /images/xyz.png,但不匹配 /images/screenshots/xyz.png)
    3. 多段通配符:引用特定路径处或下方的所有路径。语法 - match /images/{images=**} (匹配 /images/xyz.png,也匹配 /images/screenshots/xyz.png)

    希望对你有帮助。

    Reference for more info

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-01-03
      • 2022-01-18
      • 2017-08-02
      • 2020-07-03
      • 2020-03-24
      • 1970-01-01
      • 2016-09-27
      相关资源
      最近更新 更多