Remove base rest handler unconsumed parameter filter to force response parameter validation.#94711
Remove base rest handler unconsumed parameter filter to force response parameter validation.#94711howardhuanghua wants to merge 6 commits intoelastic:mainfrom
Conversation
|
@howardhuanghua please enable the option "Allow edits and access to secrets by maintainers" on your PR. For more information, see the documentation. |
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
DaveCTurner
left a comment
There was a problem hiding this comment.
So yes I think we should validate "response" params up front, there is no point in processing a request and then blowing up when serialising the response because one of these parameters was invalid. But we have to actually do some meaningful validation, we can't just blindly consume the parameters like this PR proposes. For instance we should check that boolean parameters will parse as booleans, ClusterState$Metric won't throw an IllegalArgumentException, and so on...
OK. I would do case by case validation. That should be a huge project. |
|
I think it's not all that big a task, there's only these things that I can see:
|
|
OK. I am going to add specific validations. |
c643df3 to
ac5dfa3
Compare
|
Hi @DaveCTurner , sorry for the delay. I have updated this PR and added related pre-validation logic for response paramaters. Would you please help to check again? Thanks. |
This PR is a follow-up enhancement for #94136.
Remove base rest handler unconsumed parameter filter and force validating response parameters in rest prepare request layer.