-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Console] Update autocomplete route configuration to include proxy headers #149498
[Console] Update autocomplete route configuration to include proxy headers #149498
Conversation
} | ||
|
||
const hasHostHeader = Object.keys(requestHeaders).some((key) => key.toLowerCase() === 'host'); | ||
if (!hasHostHeader) { |
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.
could we add some comments here on why this replacement needs to be made?
…-ref HEAD~1..HEAD --fix'
💚 Build Succeeded
Metrics [docs]Unknown metric groupsESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
To update your PR or re-run it, just comment with: cc @mibragimov |
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.
Pinging @elastic/platform-deployment-management (Team:Deployment Management) |
@mibragimov would you mind updating the PR description when you get a chance to explain why this is only needed for 8.6? |
I've added a small section in the summary, but feel free to add more context if you feel like we need to @mibragimov |
I have Kibana 8.6.2 and dropped a console.log into the getEntity function to check both the headers and response, and both look fine, yet autocomplete is still not working? |
Summary
This PR updates the autocomplete route configuration to include missing proxy headers such as
x-forwarded-for
,x-forwarded-host
,x-forwarded-port
, andx-forwarded-proto
to ensure that remote headers are forwarded to the Elasticsearch server. And also adds a check to ensure that thehost
header is set to the hostname if it is not already set. Users reported that the autocomplete indices were not showing up in the autocomplete dropdown in some cases due to the misconfiguration in autocomplete route. This PR should fix that issue.This PR is only aimed to 8.6.x since in main we recently merged a PR which refactors this raw queries in favour of using the native es client which already takes into consideration proxy header and es ssl configurations.
Testing
To test this PR, verify that the correct headers are being sent to the Elasticsearch server when using the autocomplete route. You can use the
console.log
statement in thegetEntity
function to verify that the headers are being sent correctly.Release note
This PR fixes an issue where the autocomplete indices were not showing up in the autocomplete dropdown in some cases due to the misconfiguration in autocomplete route.
Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers