couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "mikeal (JIRA)" <j...@apache.org>
Subject [jira] Created: (COUCHDB-692) validation function failures do not stop _update document creation
Date Fri, 12 Mar 2010 19:06:27 GMT
validation function failures do not stop _update document creation
------------------------------------------------------------------

                 Key: COUCHDB-692
                 URL: https://issues.apache.org/jira/browse/COUCHDB-692
             Project: CouchDB
          Issue Type: Bug
            Reporter: mikeal
            Priority: Critical


I noticed a pretty serious bug working on js-registry.

"updates" : { "package", "function (doc, req) { return [{forbidden:\"cannot use this\", \"_id\":\"bad\"},
\"cannot use this\"] }" }, 
"validate_update_doc" : "function (newDoc, oldDoc, user) { if (newDoc.forbidden) { throw "this
should fail" } "

What this should do is block the creation of the newDoc, but it doesn't, a new document with
_id = "bad" is created. Even worse, if you don't have a doc id a document with an empty id
is created.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message