Return-Path: Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: (qmail 79499 invoked from network); 21 Apr 2009 00:04:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Apr 2009 00:04:34 -0000 Received: (qmail 35422 invoked by uid 500); 21 Apr 2009 00:04:34 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 35346 invoked by uid 500); 21 Apr 2009 00:04:33 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 35337 invoked by uid 500); 21 Apr 2009 00:04:33 -0000 Delivered-To: apmail-incubator-couchdb-commits@incubator.apache.org Received: (qmail 35334 invoked by uid 99); 21 Apr 2009 00:04:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Apr 2009 00:04:33 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.130] (HELO eos.apache.org) (140.211.11.130) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Apr 2009 00:04:33 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id A91B6118BB for ; Tue, 21 Apr 2009 00:04:12 +0000 (GMT) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Apache Wiki To: couchdb-commits@incubator.apache.org Date: Tue, 21 Apr 2009 00:04:12 -0000 Message-ID: <20090421000412.26697.35358@eos.apache.org> Subject: [Couchdb Wiki] Update of "Security Features Overview" by SamuelWan X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification. The following page has been changed by SamuelWan: http://wiki.apache.org/couchdb/Security_Features_Overview New page: An overview of security features focusing on what CouchDB provides out of the box. Points of integration to other tiers may be mentioned but better elaborated elsewhere. === Authentication === CouchDB ships with basic authentication that compares user credentials to Admin accounts. See Setting_up_an_Admin_account for more details. You can specify a custom authentication handler and the web authentication scheme in the configuration file. The example below specifies that CouchDB will use the default_authentication_handler method defined in the [http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_httpd.erl?view=markup couch_httpd] module: {{{ authentication_handler = {couch_httpd, default_authentication_handler} WWW-Authenticate = Basic realm="administrator" }}} Other notes: The "null_authentication_handler" in "couch_httpd" allows any user credentials to run as admin. Web servers such as Apache or Nginx can also provide an authentication layer as a reverse-proxy to CouchDB. === Authorization === CouchDB supports one role, the "admin" group, which can execute any of the HTTP API on any database in the CouchDB instance. See Setting_up_an_Admin_account for more details. CouchDB does not support other roles at this time. === Validation === A design document may define a member function called "validate_doc_update". Any request to create or update a document must first pass through each "validate_doc_update" function defined in each design document. The validation functions are executed in an unspecified order. A design document can contain only one validation function. Example of a design document that validates the presence of an "address" field and returns : {{{ { _id: "_design/myview", validate_doc_update: "function(newDoc, oldDoc, userCtx) { if(newDoc.address === undefined) { throw {missing_field: 'Document must have an address.'}; }" } }}} The result of a document update without the address field will look like this: {{{ HTTP/1.1 401 Unauthorized WWW-Authenticate: Basic realm="administrator" Server: CouchDB/0.9.0 (Erlang OTP/R12B) Date: Tue, 21 Apr 2009 00:02:32 GMT Content-Type: text/plain;charset=utf-8 Content-Length: 57 Cache-Control: must-revalidate {"error":"missing_field","reason":"Document must have an address."} }}}