解析服务器安全

Parse Server Security

我是 运行 Parse Server (https://github.com/ParsePlatform/parse-server-example), which I am controlling using the Parse Server Dashboard (https://github.com/ParsePlatform/parse-dashboard) 的全新 Heroku 和 MLab 安装。

我可以拨打休息 API 电话并创建新的 类。如何防止通过 API 调用(登录用户或匿名用户)创建新的 类?

目前Parse Server Dashboard中好像没有这个控制。

我在这里找到了问题的答案:

http://stansidel.com/2016/03/parse-server-security-considerations-and-server-updates/

设置 allowClientClassCreation,这是 Parse Server 设置中的高级选项之一。

我已将 enableAnonymousUsers 设置为 false 以防止匿名调用 API.

index.js 中的相关代码片段现在如下所示:

var api = new ParseServer({
  databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
  cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
  appId: process.env.APP_ID || 'myAppId',
  masterKey: process.env.MASTER_KEY || '', //Add your master key here. Keep it secret!
  serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse',  // Don't forget to change to https if needed
  enableAnonymousUsers: process.env.ANON_USERS || false,
  allowClientClassCreation: process.env.CLIENT_CLASS_CREATION || false,
  liveQuery: {
    classNames: ["Posts", "Comments"] // List of classes to support for query subscriptions
  }
});