【问题标题】:Parse Server Security [closed]解析服务器安全 [关闭]
【发布时间】:2016-04-15 21:55:37
【问题描述】:

我正在运行 Parse Server (https://github.com/ParsePlatform/parse-server-example) 的全新 Heroku 和 MLab 安装,我正在使用 Parse Server Dashboard (https://github.com/ParsePlatform/parse-dashboard) 进行控制。

我可以调用 Rest API 并创建新类。如何防止通过 API 调用(通过登录用户或匿名)创建新类?

目前 Parse Server Dashboard 中似乎没有对此进行控制。

【问题讨论】:

    标签: mongodb parse-platform parse-server


    【解决方案1】:

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

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

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

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

    现在 index.js 中相关的 sn-p 代码如下:

    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
      }
    });
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-11-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多