Firebase 只允许云函数访问读写

Rua*_*uan 3 firebase firebase-security google-cloud-functions google-cloud-firestore

出于安全原因,我只希望云功能能够访问我的 Firestore 数据。然后让我的应用程序调用我的云函数来获取数据。

我找不到任何关于锁定您的数据库以便只有您的云功能可以访问它们的文档。

Ren*_*nec 13

你只需要拒绝所有访问如下

// Deny read/write access to all users under any conditions
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if false;
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

事实上,Cloud Functions 以管理权限运行,因此它们将完全绕过安全规则


归档时间:

查看次数:

1271 次

最近记录:

5 年,12 月 前