couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Moore (JIRA)" <j...@apache.org>
Subject [jira] [Created] (COUCHDB-2034) authentication_handlers does not accept complex arguments
Date Tue, 21 Jan 2014 05:09:19 GMT
Daniel Moore created COUCHDB-2034:
-------------------------------------

             Summary: authentication_handlers does not accept complex arguments
                 Key: COUCHDB-2034
                 URL: https://issues.apache.org/jira/browse/COUCHDB-2034
             Project: CouchDB
          Issue Type: Bug
            Reporter: Daniel Moore


I have written a custom authentication handler for couch, but when I use the "SpecArg" syntax
with embedded tuples, I get parse errors spinning up the server. For instance, a config like:

{code}
[httpd]
authentication_handlers = {my_mod, my_fun, [ { one, two }, { three, four } ] }
{code}

Gives:

{code}
[error] [<0.93.0>] {error_report,<0.30.0>,
                    {<0.93.0>,supervisor_report,
                     [{supervisor,{local,couch_secondary_services}},
                      {errorContext,start_error},
                      {reason,
                       {'EXIT',
                        {{case_clause,
                          {error,
                           {1,erl_parse,["syntax error before: ","'.'"]}}},
                         [{couch_httpd,make_arity_1_fun,1,
                           [{file,"couch_httpd.erl"},{line,200}]},
                          {couch_httpd,'-set_auth_handlers/0-fun-0-',1,
                           [{file,"couch_httpd.erl"},{line,194}]},
                          {lists,map,2,[{file,"lists.erl"},{line,1224}]},
                          {couch_httpd,set_auth_handlers,0,
                           [{file,"couch_httpd.erl"},{line,193}]},
                          {couch_httpd,start_link,2,
                           [{file,"couch_httpd.erl"},{line,130}]},
                          {supervisor,do_start_child,2,
                           [{file,"supervisor.erl"},{line,310}]},
                          {supervisor,start_children,3,
                           [{file,"supervisor.erl"},{line,293}]},
                          {supervisor,init_children,2,
                           [{file,"supervisor.erl"},{line,259}]}]}}},
                      {offender,
                       [{pid,undefined},
                        {name,httpd},
                        {mfargs,{couch_httpd,start_link,[]}},
                        {restart_type,permanent},
                        {shutdown,brutal_kill},
                        {child_type,worker}]}]}}
{code}

This seems to be as a result of [using a regex|https://github.com/apache/couchdb/blob/master/src/couchdb/couch_httpd.erl?source=c#L224-L225]
to split the tuples. Perhaps we could change the strategy to wrapping the string with "\["
and "\]" and parsing it altogether?





--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Mime
View raw message