Repository navigation
feat(superset): connection mutator that forwards the user's token, refresh fix and per-user cache - #999
Merged
Conversation
…ed refresh A DB_CONNECTION_MUTATOR sets the token extra credential and the email user for a Trino connection that carries a bearer, and a patch of Superset's refresh turns a refused Dex refresh token into a new sign-in. Per-user caching is on and alerts, thumbnails and legacy chart types are off. Inert until a per-user database is imported (#968 slice 4.3). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UVCVTjBeDDjt4VS5rJeaPi
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This was referenced Nov 7, 2026
…connection-mutator # Conflicts: # infra/terraform/environments/local/contracts.tf # tools/olf/tests/infra/test_superset_oidc.py
This was referenced Nov 8, 2026
mkumar1205-beep
pushed a commit
to mkumar1205-beep/openlakeforge
that referenced
this pull request
Nov 24, 2026
Publish a Superset image built from the current images/superset: the digest pinned since 0.5.0-alpha.1 predates OpenLakeForge#999, so a fresh `olf infra deploy` from main crashes the Superset pods with `ImportError: cannot import name 'trino_settings' from 'olf_oidc'` and the platform apply times out on helm_release.superset (OpenLakeForge#1018). This bump only cuts the release; the digest pin and the drift guard follow in the OpenLakeForge#1018 fix once the image exists.
mkumar1205-beep
pushed a commit
to mkumar1205-beep/openlakeforge
that referenced
this pull request
Nov 24, 2026
…ift (OpenLakeForge#1018) (OpenLakeForge#1073) * feat(release): guard catalog image pins against their build source `olf release check` (through `olf check components`) now fails when the source a pinned image was built from changes without the image being republished and its digest repinned. `components.image_sources` records a fingerprint of `images/<image>` (everything but the README, which never enters the build context) plus the catalog's build-input pins, so a base bump also invalidates it. The superset pin once lagged `images/superset` by three days after OpenLakeForge#999: a deploy of main crashed the Superset pods on `ImportError` because `superset_config.py` imported `trino_settings` the pinned image predates (OpenLakeForge#1018). The digest pin and the recorded fingerprint for this tree follow in the same PR once the 0.5.1-alpha.3 release publishes the image. * fix(release): repin the superset image to the 0.5.1-alpha.3 build The pinned digest (0.5.0-alpha.1) predates OpenLakeForge#999: superset_config.py imports trino_settings from olf_oidc, which exists only in images built from the current images/superset, so a fresh olf infra deploy on amd64 crashed the Superset web and worker pods and timed out the platform apply on helm_release.superset (OpenLakeForge#1018). The digest is the one the v0.5.1-alpha.3 release workflow published and signed from this same tree (release-assets-superset artifact); the source fingerprint recorded beside it in the catalog proves they match.
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.
Closes #986 (slice 4.2 of #968, tracker #960). 11 files, about 330 changed lines.
What changed
images/superset/olf_trino.py:db_connection_mutatorsetsextra_credential=[("token", t)]anduser=<email>for a Trino connection that carries a bearer inhttp_session. It strips a URI password, which would otherwise replace the bearer, and copiesverifyonto the supplied session. With no bearer, or a non-Trino engine, it changes nothing.install()wrapsTrinoEngineSpec.get_oauth2_fresh_token. A 400/401 from Dex becomesTrinoAuthError, so Superset deletes the refused token and the user signs in again. It also storesexpires_in - 60.olf_oidc.trino_settings(used only by theopenlakeforge_oidcoverride, so only with people's access):DATABASE_OAUTH2_CLIENTS["Trino"]on thesupersetDex client, withrequest_content_type: "data"because Dex takes a form body.DATABASE_OAUTH2_REDIRECT_URIper stage.CACHE_QUERY_BY_USERandCACHE_IMPERSONATIONon;ALERT_REPORTSandTHUMBNAILSoff.VIZ_TYPE_DENYLISTlists the 28 legacyviz.pytypes, taken from the 6.1.0 source.oidcobject gainsdatabase_redirect_uriandpeople_catalog. The local environment sets them, and the Dexsupersetclient accepts the extra redirect/api/v1/database/oauth2/.trino==0.340.0(was>=0.336,<1) andolf_trino.pyis copied into the image.patch_trino_iceberg_partitions.py:_is_iceberg_databasenow matches the last URI segment againstOLF_ICEBERG_CATALOGS(["iceberg", "<stage>"]). ADR 0019 item 7 names the stage's people catalog<stage>.test_superset_trino.py, plus one assertion updated intest_superset_oidc.py.Verified against source
I read the Superset 6.1.0 wheel and trino 0.340.0 for
core.py(mutator call site and signature),utils/oauth2.py(refresh and delete-on-oauth2_exception),base.py(get_oauth2_fresh_token),trino.py(impersonate_user),viz.py, and the trinodbapi/dialecthandling ofhttp_session,verifyand password.Notes
tools/olf/testswith Superset and trino stubbed, like the existingtest_superset_oidc.py. They cover headers, refresh, a refused refresh token, and no bearer leaving the connection unchanged. They do not run a fake Trino or Dex over HTTP inside the image.olf check allpasses the Terraform and container checks, then stops at "project-code check requires Python >=3.12,<3.13; found 3.13". That is this sandbox's interpreter and unrelated to the change.terraform fmtwas not available here, and I aligned the HCL by hand.Not done, noted for later
trustedPeersentry (olf-clitrustingsuperset) is not in this issue's scope. Theaudience:server:client_id:olf-cliscope will be refused until it exists, so it must land before slice 4.3.Release note
Superset image: adds a Trino connection mutator and refresh fix, inert until a per-user database is imported.
Runtime verification (kind e2e) pending: done by the coordinator
The Superset image must be rebuilt and loaded locally. The mutator is not in the published digest, so run
BUILD_SUPERSET_IMAGE=true olf infra deploy --provider local, orolf images build supersetthenolf infra images load superset. Then check:olf infra e2e run --env localis unchanged. Superset starts with the new config, the people login works, and the existing dashboards render with no per-user database.olf_trinoorolf_oidc.trino_settings.supersetclient lists both redirects:/oauth-authorized/olfand/api/v1/database/oauth2/.SUPERSET_BASE_IMAGEunchanged,pip show trinoin the image reports 0.340.0.Generated by Claude Code