Repository navigation
[2.1] Fixes #36608: Close push-feed sockets when the authentication provider changes - #38587
Merged
Merged
Conversation
…r changes (#38248) * test: push-feed handshake and sweep against a provider no longer configured (#36608) Regression tests that fail on main: a cookie handshake for a session issued by a provider that is no longer configured is accepted (SocketAddressFilterTest, SessionMultiNodeIT), and the socket sweep keeps such sockets open (WebSocketManagerTest). * Fixes #36608: close push-feed sockets when the authentication provider changes Push-feed sockets ignored the rule that a session issued by a provider that is no longer configured stops working: - The cookie handshake (SocketAddressFilter.validateSessionStillActive) and the 60 s socket sweep (WebSocketManager.isSessionActiveForUser) never checked the session's provider. - Sockets opened with a provider token and no session (the default public-client SSO setup) are never re-checked at all, so they outlived the swap. SessionProviders.isFromAnotherProvider is now the one predicate. JwtFilter, refresh, the handshake and the sweep decide through it, and a security reload that really changes the provider closes every socket on that server, with or without a session. A basic/openmetadata rename closes nothing. Sockets are closed; sessions are not revoked, as JwtFilter does not revoke them either. Amends ADR 2026-10-20 (v2) and the session design doc (8.1, 8.4). * Close a push-feed socket that registers after a provider switch (#36608) The websocket transport validates the token on the upgrade, but the socket only enters activityFeedEndpoints when the client's CONNECT arrives a round trip later. A handshake validated under the old provider just before a reload could register after disconnectAll and survive the switch; the sweep skips it because it has no session. The handshake now stamps the provider of the JwtFilter that validated it (AuthProvider header, next to UserId/SessionId, on both transports). The connection handler registers the socket first, then compares the stamp with the configured provider and closes it on a mismatch. The configuration is swapped before the reload closes sockets, so either disconnectAll or the registration check catches it. * Judge push-feed sockets against the provider the socket filter applied (#36608) A security reload publishes its configuration, and hands it to SessionService, before it initializes the new authenticator, and rolls everything back if that fails. The registration check read the published configuration and the sweep read SessionService's, so a Google-to-LDAP save whose LDAP initialization then failed could close Google sockets that the rolled-back server still accepts. The UI does not reconnect after a server close, so those feeds stayed down. Registration and the sweep now judge against SocketAddressFilter.validatingProvider(). Only the reload listener rebuilds that filter, and it runs only for a reload that succeeded. WebSocketManager is built on it through OpenMetadataApplication.buildPushFeedSockets. A real switch is still caught either way: the socket registers before its check, and the listener rebuilds the filter before disconnectAll. The handshake's session check stays on SessionService: in that window it answers 401, which the UI retries, as REST does then. (cherry picked from commit 64141df)
gh-bot-collate
Bot
requested review from
TeddyCr
and removed request for
a team
November 24, 2026 10:19
Author
|
🤖 This backport will not merge itself: |
15 tasks done
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.
Automated backport of #38248 to
2.1.64141df33a3ea7fd46f2746f0b7a47d424bc5d32main.Opened from openmetadata-collate, which holds the credentials needed to open a PR here. It merges itself once this branch's required checks pass — no review needed. If a check fails it stays open and the author of #38248 is asked to look.
resolver run