Skip to content

feat: hand over additional headers to websocket upgrade request handl…#49623

Open
thorbenheins wants to merge 6 commits into
Azure:mainfrom
thorbenheins:feature/map-additional-headers-to-websocket-upgrade-request
Open

feat: hand over additional headers to websocket upgrade request handl…#49623
thorbenheins wants to merge 6 commits into
Azure:mainfrom
thorbenheins:feature/map-additional-headers-to-websocket-upgrade-request

Conversation

@thorbenheins

Copy link
Copy Markdown

We want to use the customEndpointAddress() feature of the ServiceBusClient and need to add an Authorization Header containing the JWT being used downstream to the WebSocket upgrade request. Currently the request does not map the add the addtional headers being configured when constructing the client to this initial request.

Making the ConnectionOptions protected might be unacceptable, not sure. One could also add a getter or similar that only grants access to the headers and not all the other options in there.

Description

see above.

…ing so customEndpointAddress() instances that need authorization can be provided one.
Copilot AI review requested due to automatic review settings June 24, 2026 14:57
@thorbenheins thorbenheins requested review from a team and conniey as code owners June 24, 2026 14:57
@github-actions github-actions Bot added Azure.Core.AMQP azure-core-amqp Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Jun 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution @thorbenheins! We will review the pull request and get back to you soon.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the AMQP-over-WebSockets connection path in azure-core-amqp to pass additional ClientOptions headers into the initial WebSocket HTTP Upgrade request, enabling scenarios like forwarding an Authorization header when using customEndpointAddress() (e.g., with Service Bus).

Changes:

  • Forward ClientOptions headers into WebSocketImpl.configure(...) for WebSocket upgrade requests.
  • Relax ConnectionHandler’s connectionOptions field visibility to enable access from WebSocket-related subclasses.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/WebSocketsConnectionHandler.java Builds and passes a header map from ClientOptions into the WebSocket upgrade configuration.
sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/implementation/handler/ConnectionHandler.java Changes connectionOptions visibility to protected so subclasses can read it.

@thorbenheins

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Azure.Core.AMQP azure-core-amqp Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants