-
Notifications
You must be signed in to change notification settings - Fork 85
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
http
map
not fully supported
#103
Comments
6 tasks
chrisnovakovic
added a commit
to chrisnovakovic/crossplane
that referenced
this issue
Jul 19, 2022
The `map` directive (from ngx_http_map_module and ngx_stream_map_module) and `types` directive (from ngx_http_core_module) are distinct from other directives, in that their child directives may be arbitrary strings that aren't known to Nginx. This causes crossplane to report unrecognised/misused directive errors when analysing them with `strict` or `check_ctx` enabled; it also means that no meaningful analysis can be be performed when `check_args` is enabled because the arity of child directives is unknown. Add support for `map`'s special directives (`default`, `hostnames`, and `volatile`) to the analyser. Recognise that arbitrary directive names inside a `map` or `types` block are valid and that they accept either one argument (if used in `map`) or one or more arguments (if used in `types`). Fixes nginxinc#101 and nginxinc#103.
chrisnovakovic
added a commit
to chrisnovakovic/crossplane
that referenced
this issue
Jul 19, 2022
The `map` directive (from ngx_http_map_module and ngx_stream_map_module) and `types` directive (from ngx_http_core_module) are distinct from other directives, in that their child directives may be arbitrary strings that aren't known to Nginx. This causes crossplane to report unrecognised/misused directive errors when analysing them with `strict` or `check_ctx` enabled; it also means that no meaningful analysis can be performed when `check_args` is enabled because the arity of child directives is unknown. Add support for `map`'s special directives (`default`, `hostnames`, and `volatile`) to the analyser. Recognise that arbitrary directive names inside a `map` or `types` block are valid and that they accept either one argument (if used in `map`) or one or more arguments (if used in `types`). Fixes nginxinc#101 and nginxinc#103.
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
This is similar to #101 but slightly different because of the extra expressiveness of
map
compared totypes
.The analyser doesn't take into account the special syntax of
http
map
blocks, in which directives are one of a handful of special directives or arbitrary strings. The analyser also doesn't support any of the special directives listed in thengx_http_map_module
documentation. This means that crossplane doesn't recognise Nginx configurations containingmap
blocks as valid when running in strict mode, which verifies that directive names are present in the analyser's allowlist. A similar problem occurs whencheck_ctx=True
is set via the API.To Reproduce
Run
crossplane parse --strict
on the following Nginx configuration:This outputs:
Expected behavior
No errors are encountered, and an AST is printed.
Your environment
crossplane v0.5.7 (although the problem also exists on master)
The text was updated successfully, but these errors were encountered: