Skip to content

Conversation

@edoakes
Copy link
Collaborator

@edoakes edoakes commented Nov 19, 2025

Cherry pick: #58819

…th token in dashboard (ray-project#58819)

support `X-Ray-Authorization` header for accepting auth token. this is
used by kuberay to pass auth token when it is making requests to ray
dashboard through Kubernetes API via proxy.

this only affects api's using the middleware (dashboard head and runtime
env agent server)

---------

Signed-off-by: sampan <sampan@anyscale.com>
Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
Co-authored-by: sampan <sampan@anyscale.com>
Co-authored-by: Edward Oakes <ed.nmi.oakes@gmail.com>
@edoakes edoakes requested a review from a team as a code owner November 19, 2025 20:39
@edoakes edoakes added the go add ONLY when ready to merge, run all tests label Nov 19, 2025
gemini-code-assist[bot]

This comment was marked as outdated.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Client auth function ignores X-Ray-Authorization header

The get_auth_headers_if_auth_enabled function now needs to check for both Authorization and X-Ray-Authorization headers when determining whether to add automatic authentication headers. Currently it only checks for Authorization, so if a user provides an X-Ray-Authorization header, the function will still add an Authorization header, potentially overriding the user's intent. The function should recognize the X-Ray-Authorization header as existing user-provided authentication and skip adding headers in that case.

python/ray/_private/authentication/http_token_authentication.py#L91-L99

# Check if user provided their own Authorization header (case-insensitive)
has_user_auth = any(
key.lower() == authentication_constants.AUTHORIZATION_HEADER_NAME
for key in user_headers.keys()
)
if has_user_auth:
# User has provided their own auth header, don't override
return {}

Fix in Cursor Fix in Web


@aslonnie aslonnie merged commit d7f8055 into ray-project:releases/2.52.0 Nov 19, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants