Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Firebase 访问firestore集合_Firebase_Vue.js_Google Cloud Firestore_Vuex - Fatal编程技术网

Firebase 访问firestore集合

Firebase 访问firestore集合,firebase,vue.js,google-cloud-firestore,vuex,Firebase,Vue.js,Google Cloud Firestore,Vuex,我是来firestore的,我喜欢您可以轻松地将集合集成到客户端应用程序中的方式 目前,我直接从vue商店访问我的收藏,如下所示: async createPost({ state, commit }, post) { await fb.postsCollection.add({ createdOn: new Date(), content: post.content, userId: fb.auth.currentUser.uid, userName: st

我是来firestore的,我喜欢您可以轻松地将集合集成到客户端应用程序中的方式

目前,我直接从vue商店访问我的收藏,如下所示:

async createPost({ state, commit }, post) {
  await fb.postsCollection.add({
    createdOn: new Date(),
    content: post.content,
    userId: fb.auth.currentUser.uid,
    userName: state.userProfile.name,
    comments: 0,
    likes: 0
  })
}

这安全吗?因为数据库直接向客户端公开。因此,可能会发生未经授权的数据操纵。我是否应该将数据库操作移动到类似于express API的位置,以便只在服务器端执行数据库操作?我找到的所有示例和文档都在客户端,数据库都受到安全规则的保护。

我们无法确定这是否“安全”,因为我们不知道您的应用程序的安全要求。由您决定安全策略并在应用程序中实施它们。您可能想了解一些有助于实现这一点的安全规则。您能指出您的安全顾虑吗?@Juancki我担心数据库会直接暴露于客户端。因此,可能会发生未经授权的数据操纵。但正如道格指出的那样,我正在审查安全规则,我想我可以这样做:——capiono 23分钟前如果您对数据的某些特定部分存在安全问题,您始终可以使用Firebase功能创建对该数据的单独访问,并在那里应用上载/下载的进一步控制/权限。