Conversation
|
I've merged the main branch into this one, because contains the changes I had made for fixing the CI and it wasn't allowing the pipeline be green for integrating this fix. |
rnewson
left a comment
There was a problem hiding this comment.
The principle of allowing escaped equals characters in the key seems safe to me after some consideration. however I don't think this patch is quite right yet. below is an example of the problem;
re:run("a\=\=b = b\=c",<<"(.*(\\\\=)?\\S)(\\s?=\\s?)(.*)">>, [{capture,[1,4],list}]).
{match,["a==b = b","c"]}
despite the clear intention of the input string, the regex has misinterpreted the division between key and value (correct answer should be "a==b" and "b=c" (assuming we decide not to unescape on the value side, which could be argued either way.
| ";" ++ _Comment -> | ||
| {AccSectionName, AccValues}; | ||
| Line2 -> | ||
| case re:split(Line2, "\s?=\s?", [{return, list}]) of |
There was a problem hiding this comment.
would re:split(Line2, "\s?(?<!\\\\)=\s?", [{return, list}]) work here? (that is, split the string only on = when not immediately preceded by \.
|
finally noting this is not a refactor as it changes the behaviour of the software. |
|
Note: config application was moved to the main repo. This PR can probably be closed or moved to the main repo |
Refactor of config file parser in order to allow equals characters on the keys escaping them with a backslash.
Needed for allowing declaring jwt:kid certificates whose kid contains equal signs.
Related with these two bugs:
apache/couchdb#3319
apache/couchdb#2188