Repository navigation
[camel-4.18.x] CAMEL-25917: camel-undertow - a WebSocket connection accepted while only a producer served the path is not treated as having passed a later consumer's custom handlers - #28506
Merged
davsclaus merged 1 commit intoOct 26, 2026
Conversation
…nly a producer served the path is not treated as having passed a later consumer's custom handlers (apache#28237) * CAMEL-25917: camel-undertow - a WebSocket connection accepted while only a producer served the path is not treated as having passed a later consumer's custom handlers * CAMEL-25917: close WebSocket peers that no longer pass the path checks when the consumer starts Close the already-open connections of a path right away when a consumer is set, rather than only when they next send a message, so a receive-only client is told to reconnect instead of silently receiving nothing after the consumer with custom handlers starts. Add a regression test that awaits the close without the client sending, and adjust the existing window tests for the now proactive close. * CAMEL-25917: camel-undertow - make the window tests tolerate the proactive close The consumer now closes a connection opened before it started as soon as it starts, so sending on that connection afterwards is best effort and bounded. (cherry picked from commit 56aa5f4)
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.
Jira: https://issues.apache.org/jira/browse/CAMEL-25917
Backport of #28237 to
camel-4.18.x(cherry-pick of 56aa5f4).On a WebSocket path whose producer applies a security provider or allowed roles, a connection accepted while only the producer served the path, before its consumer was first started, did not run the custom
handlersthat the consumer configures. Once the consumer started, that connection was still served. The handshake result now records whether it ran in consumer mode, so such a connection is no longer served once a consumer withhandlersis up, and the consumer closes it as soon as it starts. The window tests send on that connection on a best effort basis, since it may already be closed.camel-4x-upgrade-guide-4_24.adocdoes not exist on this branch, so it is left out. On this line, thehandlers,allowedRolesand security provider options apply to WebSocket endpoints from 4.18.6 on (CAMEL-25375), so the doc-sync PR onmainextends the existing 4.18.6 camel-undertow WebSocket entry.UndertowWsOAuthProfileConsumerWindowTestdoes not exist on this branch (theoauthProfilesupport of CAMEL-23723 is not on 4.18.x), so its change is left out.CamelWebSocketHandlerapplied without a textual conflict. This branch has no OAuth checks in the handler, so the change only touches the handshake result,isAuthenticatedand the new close of the peers when the consumer is set, as onmain.Tests:
components/camel-undertowmvn verifyon this branch: BUILD SUCCESS, 199 tests, 0 failures, 1 skipped (includingSecurityProviderWebSocketConsumerHandlersWindowTestandUndertowWsSecurityWithoutProviderTest)