This repository has been archived by the owner on Jan 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 37
Use Input Filter keys as query whitelist #115
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
weierophinney
suggested changes
Jul 26, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will make a nice addition. I've made a comment below, and, otherwise, we need tests and updated docs (README.md
) for this feature.
Thanks!
@@ -237,6 +237,12 @@ protected function setControllerOptions(array $config, RestController $controlle | |||
|
|||
$query = $request->getQuery(); | |||
$params = new Parameters([]); | |||
|
|||
// If a query Input Filter exists, use its keys as query whitelist | |||
// instead of admin query whitelist field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd argue we should merge those from configuration with those from the input filter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with that, I'll update the code
weierophinney
added a commit
that referenced
this pull request
Jul 31, 2018
Use Input Filter keys as query whitelist
weierophinney
added a commit
that referenced
this pull request
Jul 31, 2018
Notes what release the new functionality was added in, and clarifies that it applies to a `GET`-specific input filter.
weierophinney
added a commit
that referenced
this pull request
Jul 31, 2018
- Adds entry for #115 - Removes empty stub for 1.4.1 - Sets date for 1.5.0
weierophinney
added a commit
that referenced
this pull request
Jul 31, 2018
Thanks, @manuscle! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Provide a narrative description of what you are trying to accomplish:
This feature make possible to use the input filter keys as query whitelist
So we don't need to manually type each field in the admin page field
I did not write unit tests because I want to know if it's a good idea or not
So tell me.
How to use it?
Create an Input Filter for zf-content-validation like this:
And try a Rest GET query with of these keys and a value as query param