Repository navigation
Fixes 33371: Tableau connected app (direct trust JWT) sign-in [Backport #37084 - 2.0] - #38483
Conversation
* feat(tableau): sign in with a connected app JWT Tableau connected apps (direct trust) let an admin give OpenMetadata a credential that is not a person's password or PAT. - TableauConnectedAppAuth (clientId, secretId, secretValue, username), shared by the dashboard and pipeline connections - build_server_config signs a 5-minute HS256 JWT carrying the 7 scopes both connectors need; site_id is passed to TSC.JWTAuth by keyword because its second positional parameter is isUat - Java converters type the new authType so the secret is masked and encrypted - 401 and owner test-connection hints name the connected-app checks - ADR:2026-11-04-tableau-connected-apps-sign-in-with-a-direct-trust-jwt Fixes #33371 * fix(tableau): keep PAT hints and share connected-app test fakes - Connected-app connections get their own test-connection error pack, so Basic and PAT connections keep their original hints - One Tableau authType class list serves both Java converters - The clients and build_server_config take TSC's Credentials base class - tests/utils/tableau_connected_app.py replaces the copies in both integration fakes and both unit test files - The exp assertion brackets the signing call, so a slow machine cannot push it past the bound Refs #33371 * fix(tableau): name the Server 2023.3 floor in connected-app hints Tableau Server before 2023.3 refuses connected-app sessions on the Metadata API, so the data-model and flow-lineage hints for a connected app now say so instead of only asking to enable the Metadata API. Basic and PAT hints are unchanged; their texts move into shared constants so the connected-app variants extend them. Refs #33371 * fix(tableau): name the host clock in the connected-app sign-in hint A skewed clock makes Tableau refuse the token at sign-in, so the connected-app rejection hint now asks to check it. The ADR states that the pipeline client's transport retries re-send the token on a 429 or 5xx, and the tests share one scope-rejection fixture. Refs #33371 * chore(playwright): auto-refresh impact-map.generated.json * docs(tableau): set the connected app floor to Tableau Server 2025.3 Tableau's REST API reference adds the connected app scopes for Query Views for Workbook, Query Flows for a Site and Get Flow Runs in API 3.27 (Tableau Cloud December 2025 / Server 2025.3), so an older Tableau Server cannot serve the charts or flows the connectors read with a connected app token. * docs(tableau): shorten the connected app Tableau Server note * feat(tableau): request the write scopes reverse metadata needs in the connected app JWT Collate's reverse metadata reuses the Tableau connection to write workbook descriptions, owners and tags, and view tags. With only the read scopes, Tableau rejects each write with 401002. Add tableau:workbooks:update, tableau:workbook_tags:update/delete and tableau:view_tags:update/delete, measured on Tableau Cloud. * test(tableau): reject sign-ins without valid credentials in the fake Tableau The fake accepted any sign-in without a JWT, so a connector that stopped sending its token would still pass both connected-app integration suites. Accept only the test PAT or a JWT that passes direct trust; answer anything else with 401. * fix(tableaupipeline): sign a fresh connected app JWT when signing in again The pipeline client signed in again with the credentials it was built with. A connected app JWT expires five minutes after it is signed, so a session Tableau ended later in a run could not be renewed. Build the credentials again from the connection on each sign-in; a PAT or password is unchanged. --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> (cherry picked from commit 9dd2d96)
2.0 has no Tableau Pipeline connector, no tests/integration/tableau harness and no #36691, so four parts of the pick change there: - TableauConnectionClassConverter keeps CONNECTION_CLASSES private. Main widened it, with a comment, only so that the factory's TableauPipelineConnection entry could reuse it, and 2.0 has no such entry. - TableauConnectionClassConverterTest drops the pipeline case, because 2.0 has no TableauPipelineConnection. - test_connection.py imports TableauConnectionConfig, which main's file already had from #36691. It drops the connected-app 401 test and the 401 case of the PAT-hints test. TSC 0.40 raises FailedSignInError for every 401, and on 2.0 _status_of matches only ServerResponseError, so a 401 from TSC gets no 401 hint on 2.0 for any auth type. On main, #36691 made _status_of match XMLError. - The decision record's guard names only the unit test file that exists on 2.0.
❌ 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 riskAdding Tableau connected-app JWT authentication with fixed metadata-write scopes expands external access authority; credential misuse could permit unintended metadata changes. Adds a Tableau connected app (direct trust JWT) sign-in option to the dashboard connector, signing a five-minute HS256 JWT and authenticating with TSC.JWTAuth. No issues found. 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 |
| TableauConnection connection = | ||
| (TableauConnection) | ||
| ClassConverterFactory.getConverter(TableauConnection.class).convert(CONNECTION); | ||
|
|
||
| TableauConnectedAppAuth auth = | ||
| assertInstanceOf(TableauConnectedAppAuth.class, connection.getAuthType()); |
There was a problem hiding this comment.
Test breaks Java style requirements
The new test omits final on the unchanged connection and auth variables and repeats "secret-value" in the fixture and assertion. CLAUDE.md requires unchanged local variables to be final and repeated strings to use a named constant. Apply both changes before merging to meet those repository requirements.
Context Used: CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Describe your changes:
Fixes #33371
Backport of #37084 (
9dd2d968317) to2.0, for the Tableau dashboard connector only. 2.0 has no Tableau Pipeline connector, so none of #37084's pipeline changes are applied.A Tableau connected app (direct trust) lets a site administrator give OpenMetadata a credential that is not a person's password or PAT. The Tableau dashboard connection gets a third
authType,TableauConnectedAppAuth: client ID, secret ID, secret value and username.build_server_configsigns a five-minute HS256 JWT with the secret value and signs in withTSC.JWTAuth.TableauConnectionClassConvertertypes the newauthType, so the server stores its secret encrypted and returns it masked. Without that, the server rejects the service with400 "Cannot convert [LinkedHashMap]". A connected-app connection also gets its own test-connection hints. #37084 has the full description, and the ADR it adds records the design.The first commit is the
-xpick of9dd2d968317(5e3941e988f). The 2.0 adaptations are in a commit of their own (8d725708472).Differences from #37084
No Tableau Pipeline changes. 2.0 has no Tableau Pipeline connector; it came to main with Fixes 24231: Tableau Prep flows and extract refreshes as a pipeline service #26500. So none of these are applied:
TableauConnectionClassConverterTest;TableauPipelineConnectionentry ofClassConverterFactory.ClassConverterFactory.javais therefore unchanged here.CONNECTION_CLASSESinTableauConnectionClassConverteralso staysprivate. Main made it package-private, with a comment, only so that the factory's pipeline entry could reuse it.No integration test changes. 2.0 has no
tests/integration/tableau/harness, because Fixes 5952: [Lineage] Draw Dashboard to Chart edges in the shared dashboard topology #34985 is main-only. So theconftest.pychanges for the connected-app runs are left out.No committed UI schema bundles. Main commits
ui/public/jsons/connectionSchemas/**andui/src/jsons/ingestionSchemas/**. 2.0 gitignoresui/src/jsons/*and builds it from the spec withparse-schema, so the 2.0 form gets the newauthTypefrom the schema change.No 401 hint on 2.0. TSC 0.40 raises
FailedSignInErrorfor every 401, and 2.0's_status_ofmatches onlyServerResponseError. So on 2.0, a 401 from TSC gets no "Authentication failed" hint, whatever the auth type. fix(tableau): diagnose a failed sign-in, enforce schema/table dbServicePrefixes, skip lineage for a failed workbook #36691 made_status_ofmatchXMLErroron main; it is not on 2.0, and this backport does not bring it.test_connection.pyimportsTableauConnectionConfig. Main's file already had that import from fix(tableau): diagnose a failed sign-in, enforce schema/table dbServicePrefixes, skip lineage for a failed workbook #36691.Context-only conflicts. 2.0 still writes
Union[...]andDict[...].client.pytakes main'stableau_server_auth: Credentials.connection.pytakes main's imports and-> Credentials. That return type replaces 2.0'sDict[str, Dict[str, Any]], soDictandAnyleave thetypingimport.build_server_configkeeps 2.0'sconnection: TableauConnectionConfig. Main's also acceptsTableauPipelineConnection.The ADR's Guard line names only the unit test file that exists on 2.0. The rest of the record is main's. That includes its pipeline context and its citation of
ADR:2026-10-30-tableau-pipeline-sign-in-again, a record that exists only on main.Kept as on main: the token's twelve scopes. These include the four that only the pipeline connector uses:
tableau:flows:read,tableau:flow_runs:read,tableau:jobs:readandtableau:tasks:read. 2.0's dashboard connector calls none of those endpoints. Keeping them means the token is the one Fixes 33371: Tableau connected app (direct trust JWT) sign-in #37084 measured on Tableau Cloud, and it matches the ADR ("the twelve scopes") and the docs panel.tests/utils/tableau_connected_app.pyis also main's file. Its sign-in fake (sign_in) is used only by main's integration fakes.Everything else matches Fixes 33371: Tableau connected app (direct trust JWT) sign-in #37084. The backport changes 23 of Fixes 33371: Tableau connected app (direct trust JWT) sign-in #37084's 41 files. In 17 of them, the lines it adds and removes are identical to Fixes 33371: Tableau connected app (direct trust JWT) sign-in #37084's. The other 6 are the ones above:
client.py,connection.py,test_connection.py, the converter and its test, and the ADR. Three generated TS files were regenerated from 2.0's own schemas withjson2ts.sh:tableauConnectedAppAuth.ts,tableauConnection.tsandserviceConnection.ts. All three are byte-identical to the committed ones.Type of change:
High-level design:
The same as #37084's, limited to the dashboard connector. See its description and ADR:2026-11-04-tableau-connected-apps-sign-in-with-a-direct-trust-jwt.
oneOfbranch is additive.Tests:
Run locally on this branch, with:
pytest==7.0.1;tableauserverclient==0.40, 2.0's pin.Use cases covered
TableauConnectedAppAuthbuilds a direct-trust JWT and signs in withTSC.JWTAuthand the site. The JWT has:kid/issheader;iss,sub,audandscpclaims;exp, and a newjtifor each sign-in.authTypemap asTableauConnectedAppAuth, so its secret is masked and encrypted.Unit tests
test_connection.py42,test_tableau.py53,test_tableau_backfill.py9,test_tableau_client.py13 andtest_tableau_redacted_upstream.py9. 126 passed, 0 failed.test_dashboard_owned_connection.py,test_source_parsing.pyandtest_workflow_parse.py, among others. 239 passed, both in one process and with-n 4 --dist loadfile.connection.pyandclient.pyput back, the 4 new connected-app tests fail. The PAT-hints test passes, as it must.connection.py20/20 andclient.py1/1. The one changed line not executed is theTYPE_CHECKINGimport ofCredentials.mvn -o -pl openmetadata-service -am package -Dtest=TableauConnectionClassConverterTestgives BUILD SUCCESS: 1 test, 0 failures.spotless:checkpasses onopenmetadata-service.ruff checkandruff format --checkpass with 2.0's config.--baselinemode=discard, withtableauserverclientresolved) reports 0 errors onconnection.pyandclient.py. Its baseline went down by 2 on these files.Backend integration tests
java_affectedplanner.CONNECTION_CLASSES, andTableauConnectionClassConverterTestcovers it. Fixes 33371: Tableau connected app (direct trust JWT) sign-in #37084 ran the impacted ITs on main.Ingestion integration tests
tests/integration/tableau/harness (see above).Playwright (UI) tests
Manual testing performed
Not run for this backport, because there is no Tableau site with a connected app here.
#37084 measured the dashboard and pipeline connectors on Tableau Cloud 2026.3.2. For both test connection and ingestion, a connected app gave the same results as a PAT. On 2.0, the "Wrong secret value" and "Disabled connected app" rows of its table would get no 401 hint (see above).
To check this on a 2.0 build:
UI screen recording / screenshots:
Not applicable: no UI code change. The connection form renders the new authentication option from the schema.
Checklist:
Fixes <issue-number>: <short explanation>, with the backport suffix.Fixes #33371above.oneOfbranch is additive.REVIEW.md.64f2b54f1e7was reviewed with fresh context against 2.0'sREVIEW.md, and its amended successor8d725708472in a second pass, which found nothing.CONNECTION_CLASSESstaysprivate(🟡)._status_ofchange (XMLError), which is outside this backport. 2.0's existing Basic and PAT 401 rule is inert for the same reason. Backporting that hunk would make all three fire.connection.pyandtests/utils/tableau_connected_app.pystay as on main (see Differences).🤖 Generated with Claude Code
No behavioral blocker was found, but the Java test must meet the repository’s explicit requirements before merging.
Findings
Summary
Adds connected-app sign-in to the Tableau dashboard connector on 2.0.
Acknowledged choices from
harshsoni2024:Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Connected-app credentials] --> B[Java converts authType] B --> C[Server encrypts secretValue] C --> D[Ingestion reads credentials] D --> E[Sign five-minute HS256 JWT] E --> F[TSC.JWTAuth] F --> G[Tableau session] G --> H[Read dashboard metadata]Reviews (1) · Last reviewed commit: "chore(tableau): adapt the connected app ..." · Reviewed by Greptile