Repository navigation
fix: fix Web Console hanging or signing out when SSO tokens expire - #617
Open
glasstiger wants to merge 2 commits into
Open
glasstiger wants to merge 2 commits into
glasstiger wants to merge 2 commits into
Conversation
Extracted from #603: the console half of questdb/questdb#7799 and questdb/questdb-enterprise#1267. Those PRs stop serving a request from the qdb_session cookie when its Authorization header is rejected, so an expired or stale bearer now gets a 401 and closes the session instead of being masked. - Refresh an ID-token bearer (acl.oidc.groups.encoded.in.token=true) by the ID token's exp claim rather than the access token's expires_in, and report a missing ID token instead of sending "Bearer undefined". - Read the bearer at send time for SQL, validation, CSV check/import and preference requests, and never let stored REST/Basic credentials replace an SSO bearer. - Coordinate token refresh in one bounded, cancellable place: queries wait up to 10s, a rotating refresh may still land within 60s, transient failures back off without logging out, and an expired bearer is never sent after a failed renewal (fixes the refresh deadlock that froze every query). - Recover from a rejected bearer: refresh and resend once (a 401 executed no SQL), ignore 401s answered for an older bearer, and log out only when the current bearer is rejected. - Show a renewal warning and a recovery view with Retry/Sign in again instead of a blank console, and report sign-in failures. - Share one client between the console and telemetry so telemetry never sends a stale bearer, and mark read-only requests as background so logout warnings only count statements and writes. - Dispatch the Enterprise Web Console e2e lane added by questdb-enterprise#1267, send the stored REST token in e2e execQuery, and extend the unit and stubbed browser auth tests.
Web Console deploy preview
|
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.
Tandem: questdb/questdb#7799, questdb/questdb-enterprise#1267
Extracted from #603. This PR contains only the console changes the two server PRs depend on; everything else stays in #603.
Why the server change needs it
questdb/questdb#7799 and questdb/questdb-enterprise#1267 tie HTTP sessions to the credentials that opened them. A request that carries the
qdb_sessioncookie and anAuthorizationheader the server rejects is no longer served from the cookie: it gets 401, and the session is closed. Until now, that cookie fallback hid stale bearers from the console. From now on, the console has to send a valid bearer and recover from a 401 itself.Changes
acl.oidc.groups.encoded.in.token=truethe bearer is the ID token. The console now schedules its renewal from the ID token'sexpclaim, instead of the access token'sexpires_in. A provider that omits the ID token gets an explicit "Missing ID token" error instead ofBearer undefined..github/workflows/enterprise_e2e.ymldispatches the Azure lane that questdb-enterprise#1267 adds.feat/qwp-entra-token-providerfor that reason, so it runs against the tandem server.e2e/commands.jsexecQuerynow sends the stored REST token for Enterprise password logins.e2e/questdbis bumped to OSSmaster(e4da5b45), the same commit fix: fix Web Console hanging when SSO token refresh fails #603 pins. "Check if OSS is on master" requires every PR's pointer to be within 5 commits of OSSmaster, andmain's pointer is 27 commits behind.Left in #603
Kept out of this PR because they aren't needed for the server change:
The hybrid files carry only the part needed here; #603 keeps the rest.
Toast/index.tsx: onlyREFRESH_FAILED_TOAST_ID.refreshFailedWarning.tsx: no Alt+N instructions.index.tsx: only the ToastContainer move.backgroundread flag and thessoAuthStaterename.auth.spec.js: only the tandem tests. The "Sign in again" focus test clicks the warning directly instead of using Alt+N.Once this is merged, merge
maininto #603 and resolve its 6 conflicts (auth.spec.js,Toast/index.tsx,refreshFailedWarning(.test).tsx,AuthProvider.test.tsx,Schema/index.tsx) with #603's version. I rehearsed this: the result is identical to #603's current tree, and its diff shrinks to the remaining changes.Merge order
web.console.versionto that releaseThe server PRs currently reference #603 for step 2. Point them at this PR.
Validation
At
58799115, plus the submodule-only commit58add5e2:yarn typecheck,yarn lintandyarn buildpass.yarn test:unitpasses: 2,878 tests in 141 files.yarn cypress run --spec 'e2e/tests/auth/*.spec.js' --browser electronagainst the production preview: 43 passing (39 auth, 4 unauthorized-recovery).Not run locally:
ENTERPRISE_E2E_ENABLEDand the pipeline from questdb-enterprise#1267. As configured there, it usesgroups.encoded.in.token=false, so the ID-token path is covered only by unit tests and the stubbed browser tests.