CouchDB只读数据库 [英] CouchDB write-only database

查看:75
本文介绍了CouchDB只读数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置一个CouchDB数据库,该数据库可以公开写入,并且只能由管理员角色读取。我怎样才能做到这一点。是否有类似的 validate_doc_update 函数用于访问文档?

I'm trying to setup a CouchDB database that could be publicly writable and only readable by the "admin" role. How can I do this. Is there a similar validate_doc_update function for accessing a document ?

推荐答案

一个可能的解决方法是为此滥用 Apache(尽管不是100%安全):

One possible workaround would be to "abuse" Apache for this (though not 100% secure):

您可以使用Apache禁止从所有人那里获取,但特定主机是管理员使用的主机...通过这种方式,用户可以写入但不能读取,并且管理员可以读取...

You can use Apache to disallow GET from everyone except specific hosts which are the ones the admin uses... this way the users can write but can't read and the admin can read...

如果将Apache配置为反向代理,您甚至可以为管理员(读+写)和用户(仅写)使用不同的URL。

You could even have different URLs for admin (read+write) and users (write only) if you config Apache as reverse proxy...

这篇关于CouchDB只读数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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