covercouch | Per-document ACL engine for CouchDB | Authorization library
kandi X-RAY | covercouch Summary
kandi X-RAY | covercouch Summary
CoverCouch implements per-document r/w/d ACL for CouchDB. CoverCouch acts as proxy – original CouchDB REST API kept untouched, but all requests to Couch – r/w/d, _changes feed, _view, _update, _list or other fn call, replication – everything is filtered. Document ACL is defined using creator,owners and acl properties of a doc. Their values, combined by _design/acl/_view/acl view function, reflect final ACL for a doc. Also CoverCouch implements per-method fine-grained ACL – some paths like _update/someFnName can be restricted for several roles or users. CoverCouch can even restrict on query basis – for example we can allow attachments=true only for several roles. All these rules, ACL view function and other ACL-related stuff are stored in _design/acl design doc. This ddoc defines access rules for particular CouchDB bucket. Buckets that have no ACL ddoc, behave as native CouchDB. Special note: reduce and _list work fine, since they are emulated and ingest only filtered _view feeds.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of covercouch
covercouch Key Features
covercouch Examples and Code Snippets
Community Discussions
Trending Discussions on covercouch
QUESTION
In my company, we use IBM Domino for more than a decade. We use it to build offline applications with replication support. It works well but we need to use the IBM Notes client to allow this feature and it doesn't work on mobile devices (except Windows laptop, of course).
I'm looking for other solutions to build offline-first and multi-support (web) applications. I think that CouchDB + PouchDB is the best solution. But to replace Domino, I have to replace the authorization feature.
Domino has many levels of rights in database ACL (Manager, Designer, Author, Writer, Reader,...). And for each document, we can add a reader and an author field which limit who can write and read document.
For example, we use Domino with our CRM, employee can read (and write) his customers and the customers of the employee who are lower him in the company hierarchy. He can also view customers in its geographical areas (no write).
To do this in Domino, we calculate (each night) a reader and an author field in every customer document. How can I achieve something like this in CouchDB? Is it possible?
I read about many possibilities:
- Partial sync with show or filter functions (CouchDB / PouchDB partial syncs with limited rights)
- One database per user. (How split database in my case?)
- Use a proxy application like covercouch to manage ACL (https://github.com/ermouth/covercouch)
- Develop my own proxy where in can implement filter functions to match my needs?
What is the best solution to solve my issue above?
...ANSWER
Answered 2017-Apr-20 at 20:50Apache CouchDB does not have per-document permissions. While you can use filtered replication to replicate only a subset of data, you should not rely on filtered replication as a form of access management. Currently, your only real viable option is to take the one-database-per user approach. You have a few options here:
- Use the
couch_peruser
configuration option in Apache CouchDB 2.0 which will create a database for every user created in the_users
database and give that user permission to read and write to their own database. - Roll your own scheme to basically do the same as above.
- Use Cloudant Envoy which allows you to provide the illusion of one-database-per user to replication targets such as PouchDB while actually storing all of this data in one database. Check out Authentication for Cloudant Envoy Apps, Part I and Part II for more details on how to use Cloudant Envoy.
- Use Hoodie. Hoodie is an entire backend for Offline First applications, leveraging Apache CouchDB on the server and PouchDB on the client. Hoodie provides APIs for managing users, persisting data, sync'ing data, and a number of other features.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install covercouch
CouchDB 1.6–1.7 and node.js 0.10.35+ required, never tested with Couch 2.x
$ git clone git://github.com/ermouth/covercouch.git folderName
$ cd folderName
$ npm install
Edit general settings in /cvr/config.js
Run $ node covercouch
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page