couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Davies <>
Subject Re: Validation functions and design documents
Date Wed, 07 Oct 2009 09:07:02 GMT
Hi Eric,

On 1 Oct 2009, at 20:33, eric casteleijn wrote:

> I was unpleasantly surprised today when I tried to implement a  
> rather critical piece of our infrastructure: the validation to  
> prevent replication of certain design documents which are run on our  
> server node(s). It appears that validation functions don't get  
> called at all when a design document is updated. I used the logging  
> example from the book:
> and this logs an entry for each update to a regular document, but is  
> eerily silent on updates to design documents.
> Is there maybe a switch I can turn on in the .ini file, or a  
> different kind of validator I can use for this purpose?

This is correct, validation functions don't appear to get called for  
design docs, instead there is a check to see whether the user is an  
admin or not.  I would imagine calling the validation function when  
the user *isn't* an admin would be a good idea.  As the validation  
functions can't mutate docs, this shouldn't cause any problems.  Does  
anyone else have any comments?

The only problem might be that this would allow design docs to be  
written by non-admins by default.  Perhaps a .ini flag  
validate_design_docs = true could be used to turn on this behaviour?

Jason Davies

View raw message