Is it possible to determine the source of an incoming request?

核能气质少年 提交于 2020-05-09 10:27:09

问题


Is it possible to know the hostname of the source of an incoming request to a cloud firestore document? I would like to write a database rule of the form allow write: if request.resource.data.source_host_name == some_predefined_value. This is a web application so I'm trying to find a good way to limit who gets to write to my database without using traditional auth methods.


回答1:


That sort of rule is not possible with Cloud Firestore. It also wouldn't be very secure, as it's possible to spoof source IP addresses.

If you want to limit who can access your database, the only supported mechanism is through security rules and Firebase Authentication.



来源:https://stackoverflow.com/questions/49385599/is-it-possible-to-determine-the-source-of-an-incoming-request

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!