Skip to content

Conversation

@tvernum
Copy link
Contributor

@tvernum tvernum commented Oct 16, 2025

When making a request to a remote cluster, we don't want to include the current project-id ("X-Elastic-Project-Id") header in the thread context that we send to the remote cluster because the current project-id is not relevant to the thread context for the remote execution.

Backport of: #136664

When making a request to a remote cluster, we don't want to include
the current project-id ("X-Elastic-Project-Id") header in the thread
context that we send to the remote cluster because the current
project-id is not relevant to the thread context for the remote
execution.

Backport of: elastic#136664
@tvernum tvernum requested a review from a team as a code owner October 16, 2025 09:37
@tvernum tvernum added >bug :Security/Authorization Roles, Privileges, DLS/FLS, RBAC/ABAC backport auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) auto-backport Automatically create backport pull requests when merged v9.1.6 v9.2.1 labels Oct 16, 2025
final Set<String> allRequestHeadersToCopy = new HashSet<>(HEADERS_TO_COPY);
if (headersFor == HeadersFor.REMOTE_CLUSTER) {
// Don't send the current project id to a remote cluster/project
allRequestHeadersToCopy.remove(Task.X_ELASTIC_PROJECT_ID_HTTP_HEADER);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just highlighting that if Task.X_ELASTIC_PROJECT_ID_HTTP_HEADER is in requestHeaders it will still keep coming. If that's okay, then it is fine, otherwise it's worth moving this logic below the addAll,

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's intentional. If you explicitly specify to preserve it in requestHeaders, then it will not be removed.
See comment here.

@elasticsearchmachine elasticsearchmachine merged commit 140b998 into elastic:9.2 Oct 16, 2025
34 checks passed
@tvernum tvernum deleted the backport/9.2/136664-Drop-project-id-from branch October 16, 2025 13:25
@elasticsearchmachine

This comment was marked as outdated.

tvernum added a commit to tvernum/elasticsearch that referenced this pull request Oct 16, 2025
When making a request to a remote cluster, we don't want to include
the current project-id ("X-Elastic-Project-Id") header in the thread
context that we send to the remote cluster because the current
project-id is not relevant to the thread context for the remote
execution.

Backport of: elastic#136664,elastic#136675
elasticsearchmachine pushed a commit that referenced this pull request Oct 17, 2025
When making a request to a remote cluster, we don't want to include
the current project-id ("X-Elastic-Project-Id") header in the thread
context that we send to the remote cluster because the current
project-id is not relevant to the thread context for the remote
execution.

Backport of: #136664,#136675
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport >bug :Security/Authorization Roles, Privileges, DLS/FLS, RBAC/ABAC v9.1.6 v9.2.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants