Skip to content
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

Recursive check for nested parameters #15

Open
migolovanov opened this issue Apr 10, 2019 · 2 comments
Open

Recursive check for nested parameters #15

migolovanov opened this issue Apr 10, 2019 · 2 comments

Comments

@migolovanov
Copy link

Hello!
It is not issue itself, but more like feature request for future: it would be great to perform recursive check of nested parameters.
For example, you have JSON as POST-arguments like {"a":{"b":{"c":1}},"d":2} and it is parsed to request.post.a.b.c = 1 and request.post.d = 2. It would be great to set single rule like request.post ~ "^[0-9]+$" to check all nested elements in request.post variable, instead of making separate checks, adopting rule to request.post.a.b.c ~ "^[0-9]+$" and request.post.d ~"^[0-9]+$".
In context of HTTP protocol, the same might be applicable for GET-arguments, headers, cookies or any parameter that may contain nested structure.

@RReverser
Copy link
Contributor

It doesn't feel very intuitive to be honest, and might be even incompatible with current design, since it's possible to add custom field for request.post in which case request.post ~ "^[0-9]+$" would have a completely different meaning.

@migolovanov
Copy link
Author

migolovanov commented Apr 13, 2019

In my opinion, if you've set request.post as string - regex will match this particular string, but if it is nested variable, regex will apply to all child elements. The issue i have met is related to situations when you don't know in advance which variables are set as GET or POST arguments and it is impossible to write a wirefilter rule, that will match all of them. So the only way i found is to rewrite the wirefilter rule for each particular parameter separately (replace parameter in wirefilter condition, create new schema, add arguments and apply filter).
I don't know if this case is relevant for you, but just wanted to point out that it may appear.

marmeladema added a commit that referenced this issue Feb 26, 2020
…udflare

* commit 'c45cbd4215c0504d7e78ec8e81eba8517cb7b99c':
  FW-2077: add len and is_empty methods to Array and Map data types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants