-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[PIP-179] Support the admin API to check unknown request parameters #16135
Labels
Comments
PIP ID is used by #16042 |
I have corrected it. Thanks |
4 tasks
Merged
4 tasks
complete. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Motivation
The design of the Admin API is now such that if an incorrect parameter name is submitted, this property (if not required) will be ignored, then execution continues, and the response is “204 Success”. This will trick the user into thinking the setup succeeded when it didn't correctly as expected in some cases, as shown below:
User POST request to /{tenant}/{namespace}/{topic}/retention" with incorrect parameter:
Which should have been this:
Response:
We can provide an optional mechanism: "fail (HTTP status 400 bad requests) on unknown request parameters".
Goal
Path variables(no need for change): This represents the domain. The current API has been validated, so no additional modifications are required.Query params(no support on this proposal): I haven't found an elegant way to do it yet, so this proposal does not include Query Param validation.Approach
When parsing the request body, any unknown property is considered a bad request. The Jackson unknown property rule is adopted:
If the check fails, return a text/plain response with 400 code. Like this:
Configuration Changes
broker.conf
Dynamic switching
Enabling this feature affects all of the broker's HTTP services, including the following:
Because of the number of apis involved, we provide dynamic configuration. When a user discovers any problem, it can be turned on and off dynamically using the Admin API(without restarting Broker), which can reduce impact.
The text was updated successfully, but these errors were encountered: