我的 Firebase API 限制设置有问题。 我想添加 HTTP 限制来保护数据,但是当我添加限制时,它不起作用。我在这里做错了什么?
使用 Github Pages 部署的网站(例如 https://username.github.io/project-name/)这是一个按照以下描述部署的 React 应用程序:https://github.com/gitname/react-gh-页
我正在使用 Firebase 身份验证。 https://firebase.google.com/docs/reference/rest/auth#section-create-email-password
为了确保 API 密钥的安全(尽管我知道 Firebase API 没有问题,以防万一),我想在 Google Cloud⇒API 和服务⇒凭据
中进行如下设置无法使用
*
与先前定义的路径来限制不同的路径。我的意思是,您可以使用 *
指定到特定域 https://username.github.io/*
(正确)的任何路径,但不能指定到路径 https://username.github.io/project-name/*
(不正确)。
您可以查看这个官方网站。在您的情况下,限制访问的唯一选项似乎是添加所有确切路径(
https://username.github.io/project-name/home
,https://username.github.io/project-name/about
,https://username.github.io/project-name/contact
...)