-
Hi everyone, We can create users in CouchDB with different rights. But is it okay to let the (web) clients have a direct access (read/write) to CouchDB? And most importantly: why? The use case here would be a website used by anyone, so not only trusted users. Thanks & regards, cluxter |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Here's a good reference (but there are also other considerations and
possibilities).
https://github.com/pouchdb-community/pouchdb-authentication/blob/master/docs/recipes.md
…On Sat, 11 Jul 2020 at 22:12, Baptiste REBILLARD ***@***.***> wrote:
Hi everyone,
We can create users in CouchDB with different rights. But is it okay to
let the (web) clients have a direct access (read/write) to CouchDB? And *most
importantly: why*?
The use case here would be a website used by anyone, so not only trusted
users.
My concerns are mainly about security (but other comments about
performance, quality of service, or other things are welcome).
Thanks & regards,
cluxter
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3000>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABKTZUQCUPT6KNIXMOZIJM3R3DBRBANCNFSM4OXOPIDQ>
.
|
Beta Was this translation helpful? Give feedback.
-
As Couch provides http access better question is “why not”. Some notes:
|
Beta Was this translation helpful? Give feedback.
-
@cluxter good question! CouchDB works fine in a traditional three tier architecture behind an application server that in turn is the only resource that has access to the database. But another option is having an open CouchDB on the internet. This is particularly useful when building offline-capable web-apps with PouchDB. In that case, CouchDB and PouchDB should be talking to each other directly, so you will be relying on the CouchDB authentication system for access control. It was designed for this specific use case. There are some limitations as @ermouth points out, but for the most important ones (IMHO), rate limiting, you can introduce an otherwise transparent HTTP proxy. tl;dr: CouchDB doesn’t force you to do this, but if you need it for sync with e.g. PouchDB, you can use it. |
Beta Was this translation helpful? Give feedback.
-
Thanks to you all for your answers, it's really helpful! One thought I had when reading your answers was: putting something like Node.js as a middleware between CouchDB and the client looks like it can increase the level of security, but it could as well weaken it by introducing some flaw(s). Actually a developer is more likely to introduce a flaw by himself developing a middleware than using the default CouchDB security layer which has been made and reviewed by several highly skilled people. |
Beta Was this translation helpful? Give feedback.
@cluxter good question! CouchDB works fine in a traditional three tier architecture behind an application server that in turn is the only resource that has access to the database. But another option is having an open CouchDB on the internet. This is particularly useful when building offline-capable web-apps with PouchDB. In that case, CouchDB and PouchDB should be talking to each other directly, so you will be relying on the CouchDB authentication system for access control. It was designed for this specific use case.
There are some limitations as @ermouth points out, but for the most important ones (IMHO), rate limiting, you can introduce an otherwise transparent HTTP proxy.
tl;dr: CouchD…