MongoLab 数据库是否有 ReadOnly REST API 密钥,还是总是 ReadWrite [英] Is there ReadOnly REST API key to a MongoLab database, or is it always ReadWrite

查看:57
本文介绍了MongoLab 数据库是否有 ReadOnly REST API 密钥,还是总是 ReadWrite的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 MongoLab 中,您生成一个 API 密钥,然后任何人都可以使用 REST API 访问您的数据库.

In MongoLab you generate an API key and then anyone can access your database using REST API.

通常的情况是直接从 Ajax 客户端使用 REST api.

Usual case is to use the REST api directly from Ajax clients.

但这让任何人都可以完全写入您的数据库,这是一个安全漏洞.

But this gives anyone complete write access to your database, which is security hole.

是否有一种方法可以生成一个 API 密钥,该密钥将提供对数据库的只读访问权限

Is there a way to generate an API key which will give READ ONLY access to the database

推荐答案

目前,所有 API 密钥都具有对与用户帐户关联的数据库的读写访问权限.如果您需要公开只读 API,我们建议您使用 Express 或 Sinatra 等众多可用框架之一构建您自己的 API.

Currently, all API keys have read and write access to the databases associated with the user's account. If you need to expose a read-only API we recommend building your own with one of the many frameworks available like Express or Sinatra.

这篇关于MongoLab 数据库是否有 ReadOnly REST API 密钥,还是总是 ReadWrite的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆