-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Warning headers are removed on any failure #75739
Comments
Pinging @elastic/es-security (Team:Security) |
While adding a warning header when a license is about to expire we also removed all the warning headers from response if it fails when handling the request in |
@BigPandaToo Where did we get to with the fix for this? |
Adding test |
We shouldn't remove warning when request is failing not because of security reasons (syntax error for ex.). Note, that security related failure could happen not only during authentication (therefore we will check for the rest status), also all failures happened during authentication will be considered security related and warnings will be removed from the response. Resolves: elastic#75739
* Don't remove warning headers on all failure We shouldn't remove warning when request is failing not because of security reasons (syntax error for ex.). Note, that security related failure could happen not only during authentication (therefore we will check for the rest status), also all failures happened during authentication will be considered security related and warnings will be removed from the response. Resolves: #75739
Whenever a request fails, the previously emitted response header warnings are removed from a response.
This was intentionally done so that when authentication fails, there would be no warnings presented to a user.
However when a failure is not related to authentication, headers are removed as well.
I suspect this behaviour fails only when security is enabled
introduced by #64948
reproduction steps:
typed
search endpoint - emits deprecation warning- and typed query - fails parsing.--url http://localhost:9200/test1/sometype/_search
--header ‘Accept: application/vnd.elasticsearch+json;compatible-with=7’
--header ‘Authorization: Basic ZWxhc3RpYzpwYXNzd29yZA==’
--header ‘Content-Type: application/vnd.elasticsearch+json;compatible-with=7’
--header ‘X-Opaque-ID: he’
--data ‘{
“query”: {
“type”:{
“value”: “_doc”
}
}
}’
The text was updated successfully, but these errors were encountered: