Skip to content

[2.1] Fixes #36608: Close push-feed sockets when the authentication provider changes - #38587

Merged
yan-3005 merged 1 commit into
2.1from
backport/2.1/pr-38248
Nov 24, 2026
Merged

yan-3005 merged 1 commit into
2.1from
backport/2.1/pr-38248

Conversation

@gh-bot-collate

Copy link
Copy Markdown

Automated backport of #38248 to 2.1.

Source PR #38248
Author @Vamsi-klu
Merge commit 64141df33a3ea7fd46f2746f0b7a47d424bc5d32
Method Clean cherry-pick — identical to the commit on main.

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

…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
gh-bot-collate Bot requested a review from a team as a code owner November 24, 2026 10:19
@gh-bot-collate
gh-bot-collate Bot requested review from TeddyCr and removed request for a team November 24, 2026 10:19
@gh-bot-collate gh-bot-collate Bot added the safe to test Add this label to run secure Github workflows on PRs label Nov 24, 2026
@gh-bot-collate

Copy link
Copy Markdown
Author

🤖 This backport will not merge itself: 2.1 has no required status checks, so there is nothing for auto-merge to wait on. Merge it by hand once CI is green.

@yan-3005
yan-3005 merged commit 8677ece into 2.1 Nov 24, 2026
47 checks passed
@yan-3005
yan-3005 deleted the backport/2.1/pr-38248 branch November 24, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants