Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 62935 invoked from network); 28 Mar 2011 15:38:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Mar 2011 15:38:59 -0000 Received: (qmail 67785 invoked by uid 500); 28 Mar 2011 15:38:58 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 67750 invoked by uid 500); 28 Mar 2011 15:38:58 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 67742 invoked by uid 99); 28 Mar 2011 15:38:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Mar 2011 15:38:58 +0000 X-ASF-Spam-Status: No, hits=2.9 required=5.0 tests=FREEMAIL_FROM,FS_REPLICA,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of nebupookins@gmail.com designates 209.85.160.180 as permitted sender) Received: from [209.85.160.180] (HELO mail-gy0-f180.google.com) (209.85.160.180) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Mar 2011 15:38:50 +0000 Received: by gyf2 with SMTP id 2so1470653gyf.11 for ; Mon, 28 Mar 2011 08:38:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=7U4gXNmWQ7a6f3glZpJgnJxVsnXKZAfUCM8ayRDVdFY=; b=aXRZEwxKHXXxJPKRBHtmQx5e8QiAQBO/5iOaxxGitUsf4BqMJQcmM4xxiVOoxqecsW 31V+qiS8UT3kZ5X8YOyFhZ3GVbKy9tvGFx0sXqhpPVlQJ+gO9YGsTVNoktk5zm+ofsSH xRDh5s5ViJl5LnEXw6GRFz4FZXMawNUnmTabw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=GwYKngiELMlWxr5opaU5ite/Ub3epWQBc5q34xCNNi6mSogee1TmjLRPmr8Qyedvvm GPIcpp1yp7ohw4cC2sfCNbCjWc3I+JJfJ+oE4S1yO9yMiIzwaCpdZtMq/Aav3BidBKcS C1YDYZhRW9Kz+tsG45GAQk7tnSO/2xPCWPT0Q= MIME-Version: 1.0 Received: by 10.150.75.9 with SMTP id x9mr3819898yba.198.1301326709251; Mon, 28 Mar 2011 08:38:29 -0700 (PDT) Received: by 10.100.163.18 with HTTP; Mon, 28 Mar 2011 08:38:29 -0700 (PDT) In-Reply-To: <4D8DDF4B.8010108@gmail.com> References: <4D8BCD50.8080003@gmail.com> <4D8DDF4B.8010108@gmail.com> Date: Mon, 28 Mar 2011 11:38:29 -0400 Message-ID: Subject: Re: Question about validator functions and replication From: Nebu Pookins To: user@couchdb.apache.org Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org On Sat, Mar 26, 2011 at 8:42 AM, Patrick Barnes wrote: >> 1) Alice and Bob are friends, and Alice lent her laptop to Bob so that >> he could do some offline blogging too. > > If 'Bob' wants to do some blogging, he *really* should be required to input > his own credentials to push any of _his_ modifications back to the central > server. In theory, you can have a solution where Bob does input his credentials at some point, but not necessarily exactly when his changes are getting pushed to the central server. For example, he could sign his changes, at one date, and then several days later, the replication occurs and the server verifies the signature. I'm just unsure of the feasibility of implementing this solution in CouchDB in practice. > As I understand it, you have a central server 'C' with a couchdb database, > and users 'A' and 'B', each of whom have a local copy of C's database. Your understanding of this example is correct, though I feel I should now mention I'd like for any solution to also work in a "decentralized" mode. It'd be a nice-to-have, but if it turns out to be impossible (I doubt it's impossible, though), I'm also interested in hearing solutions which depend on a centralized server. [...] > A: Users can have a different set of roles on different servers. So on 'C', > Alice is probably an ordinary user, but on 'A' Alice can have admin > permissions - the design doc on the target db can check the user roles and > differentiate. Thanks, I was worried about this point, but you've clarified to me that it is possible for users to have different roles on different instances of CouchDB despite replication. > If you have some secure data floating around in your db, encryption can > still be a good idea. Parts of one of my databases are encrypted, because > users need to be able to see some documents in the db but not others. I'm curious as how you've implemented encryption in your DB. Was it pure JavaScript, or did you use native libraries? Elsewhere in this thread, I've started a new "branch" where I've started outlining my concerns with a pure JavaScript solution and wondered if cryptography could be included as a core feature of CouchDB. > Finally, you can also look at filtered replication, so - *as well as* > restricting which documents can be replicated back to the central db 'C' by > whom - you can limit replication pushes to only those docs that should pass > validation. Yeah, filtered replication is always in the back of my mind, but it seems like the requirements for my problem are such that there's going to be a lot of collaboration amongst the users; the real problem isn't as simple as just a set of blog posts. > Hope that helps, > -Patrick You've been a great help, thank you. - Nebu