feat: hand over additional headers to websocket upgrade request handl…#49623
Open
thorbenheins wants to merge 6 commits into
Open
feat: hand over additional headers to websocket upgrade request handl…#49623thorbenheins wants to merge 6 commits into
thorbenheins wants to merge 6 commits into
Conversation
…ing so customEndpointAddress() instances that need authorization can be provided one.
Contributor
|
Thank you for your contribution @thorbenheins! We will review the pull request and get back to you soon. |
Contributor
There was a problem hiding this comment.
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
ClientOptionsheaders intoWebSocketImpl.configure(...)for WebSocket upgrade requests. - Relax
ConnectionHandler’sconnectionOptionsfield 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. |
Author
|
@microsoft-github-policy-service agree |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ith general code structure
…uest' of https://github.com/thorbenheins/azure-sdk-for-java into feature/map-additional-headers-to-websocket-upgrade-request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.