Added an API for allowing the caller of Parse to specify bitmasks for directives outsides the "core" set of NGINX directives. This would allow the caller to parse an NGINX configuration that contained directives from a dynamic module even if it is a unknown custom one as long as the configuration still matches the expected grammar.
As part of this I moved the NAP WAF v4 directives out of the main directives map before adding directives for WAF v5. The two versions of this module have a different set of directives that I did not want to layer on top of each other. I want to specifically call out that this means the v4 directives are not included in the main directives dictionary which means a configuration using v4 NAP directives that was parsed without error before updating Crossplane would no longer pass until the ParseOptions are updated to include the optional match function. cc: @yluf5 @nickchen
The NGINXaaS team is currently working on adding support for additional versions of NGINX and dynamic modules (including Lua) for which this seems like a viable way to add support for directives outside the core directive set that do not require something heavier such as a customer lexer or parser.
Checklist
Before creating a PR, run through this checklist and mark each as complete.
Proposed changes
Added an API for allowing the caller of
Parse
to specify bitmasks for directives outsides the "core" set of NGINX directives. This would allow the caller to parse an NGINX configuration that contained directives from a dynamic module even if it is a unknown custom one as long as the configuration still matches the expected grammar.As part of this I moved the NAP WAF v4 directives out of the main
directives
map before adding directives for WAF v5. The two versions of this module have a different set of directives that I did not want to layer on top of each other. I want to specifically call out that this means the v4 directives are not included in the main directives dictionary which means a configuration using v4 NAP directives that was parsed without error before updating Crossplane would no longer pass until theParseOptions
are updated to include the optional match function. cc: @yluf5 @nickchenThe NGINXaaS team is currently working on adding support for additional versions of NGINX and dynamic modules (including Lua) for which this seems like a viable way to add support for directives outside the core directive set that do not require something heavier such as a customer lexer or parser.
Checklist
Before creating a PR, run through this checklist and mark each as complete.
CONTRIBUTING
documentREADME.md
)~