-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[refactor] drop pcre regexes for lua patterns #209
Conversation
9fce0df
to
93fd629
Compare
Removing PCRE as a dependency would prevent anyone from using regular expressions in their plugins? Would we want to use it for handling regex based routing? Even if we're not using it now or in the future I think it should be available for third-party plugin authors. |
93fd629
to
a933c54
Compare
Patterns can also do a great job. It depends what we want to use. This (or at least a part of it) can still be merged (it's lighter than what we used to have, especially for the specs) and it doesn't remove the actual compilation with pcre (as said in the PR). If we don't remove pcre, then #167 is irrelevant. |
- switch `public_dns` validation from regex to a custom function with pattern validation (in its schema) - remove regex field in schemas and schemas.lua - uuid validation now happens with patterns in base_dao.lua
This does not remove the installation of pcre in the package build or the openresty installation of travis-ci.
cf94bce
to
46525b5
Compare
46525b5
to
2cf80ea
Compare
Changes Unknown when pulling 663e130 on refactor/patterns into * on master*. |
[refactor] drop pcre regexes for lua patterns
[refactor] drop pcre regexes for lua patterns
Following the discussion we had in #167, this PR removes the need for patterns everywhere accross Kong.
regex
field in schemas is not supported anymore. One now needs to usefunc
and use Lua patterns.Finally, I would say I really like the idea of lightening the crazy amount of dependencies Kong requires, but I am not yet 100% sure about that one. pcre is recommended by openresty here (sure, we can probably drop it if we don't use it), but future plugins might eventually want to use Perl regexps, which this will be preventing. However, plugins (and the core) could still use powerful lua pattern libraries (LPeg) if they feel the need.
I think it's a discussion we should have before merging this @montanaflynn @thefosk.