Does Cloud Functions for Firebase respect the realtime database rules?

后端 未结 1 1829
时光取名叫无心
时光取名叫无心 2021-01-28 19:52

I am trying to secure my real time database using security rules at specific nodes.

I understand that Firebase rules will apply when I write/ read using my device.

相关标签:
1条回答
  • 2021-01-28 20:04

    When you use the Firebase Admin SDK to access Realtime Database, by default it has full read and write access. The assumption with the Admin SDK is that you're running in a privileged environment where the code is fully under your control, and you know exactly what you're doing.

    The fact that your code is running in Cloud Functions has no bearing on any of this. It could just as easily be running on your desktop or some other server you control. This is a property of the Admin SDK.

    If you want to change the scope of access to Realtime Database, you will have to know the end user's UID, then initialize the SDK to limit the scope of its privilege to that UID using databaseAuthVariableOverride at the time of init.

    0 讨论(0)
提交回复
热议问题