CouchDB write-only database

流过昼夜 提交于 2020-08-02 11:08:29

问题


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 ?


回答1:


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

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...

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




回答2:


Check out this page on the wiki, it provides an introduction to setting up read/write-level security on a database level.

As of CouchDB 1.1.0, it is not possible to have write access but not also read access to a database. What you can do is write to database A and then replicate that into database B, and only the admin can read database B.



来源:https://stackoverflow.com/questions/5857955/couchdb-write-only-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!