Repository navigation
Fixes #38245: Close push feed sockets without a session when their token expires or their user is deleted (backport 2.1 #38876) - #39277
Conversation
…ken expires or their user is deleted (backport 2.1 #38876)
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved 🔴 High riskEnforces token expiry and user deletion for sessionless push-feed sockets, changing an authorization boundary where missed revocation could preserve stale access. Backports the push feed socket lifetime fix to 2.1: sockets opened with sessionless tokens (SSO public client, bot, or PAT) now close after the token's VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Issue
Cherry-pick of PR #38876 (Fixes #38245) onto
2.1.What this fixes
The UI keeps a live websocket open to the server for push updates. When a socket is opened with a token that has no login session (a public client SSO provider token, a bot token or a personal access token), the server checked the token once at connect and never again. The socket stayed open after the token expired and after its user was deleted.
With this change:
tokenExpiredChannel. The UI reconnects once with its renewed token only after that notice, so public client SSO tabs keep working. Any other server close is still final.Why 2.1
2.1has the same code asmainbefore the fix: 8 of the 10 production files are byte-identical, and the delete hook (UserRepository.beginDeleteLifecycle) andPostCommitActionQueuealready exist here.What changed from the original
Nothing. The patch is identical to the one merged on
main(samegit patch-id --stable). Git auto-mergedUserRepository.javawith no conflict, and the rest applied as is. The only difference is the commit title.Behavior change to note in the release notes
A bot token or personal access token that has an
expis now disconnected shortly after it expires, and a script using the socket has to reconnect itself. Tokens with noexpare unaffected, and so are sockets that have a session.Verification
Run on this branch (a clean
2.1worktree,2.1.2): 238 unit tests, 0 failures, acrossWebSocketManagerTest,SocketAddressFilterTest,SocketAddressFilterSpoofRevalidationBypassTest,Jetty12WebSocketHandlerTest,PushFeedUserPresenceTest,OpenMetadataApplicationAuthReloadTest,UserRepositoryUnitTest,JwtFilterTest,CacheBundleTest,FeedServletTestandHeaderRequestWrapperTest.spotless:checkpasses and theopenmetadata-integration-testsmodule compiles.Not run here: the new integration tests (
SsoPushFeedSocketIT,SessionMultiNodeIT), which CI does not run, and the Jest test forWebSocketProvider. Both were run by the author onmain, and the files they cover are identical on2.1apart fromconstants.ts, where only one line is added.