Skip to content

Fixes 33371: Tableau connected app (direct trust JWT) sign-in [Backport #37084 - 2.0] - #38483

Merged
harshsoni2024 merged 2 commits into
2.0from
backport-37084-2.0
Nov 23, 2026
Merged

harshsoni2024 merged 2 commits into
2.0from
backport-37084-2.0

Conversation

@harshsoni2024

@harshsoni2024 harshsoni2024 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #33371

Backport of #37084 (9dd2d968317) to 2.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_config signs a five-minute HS256 JWT with the secret value and signs in with TSC.JWTAuth. TableauConnectionClassConverter types the new authType, so the server stores its secret encrypted and returns it masked. Without that, the server rejects the service with 400 "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 -x pick of 9dd2d968317 (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:

    • its schema, client, connection, README, docs panel and generated TS;
    • its unit tests, and the pipeline case of TableauConnectionClassConverterTest;
    • the TableauPipelineConnection entry of ClassConverterFactory. ClassConverterFactory.java is therefore unchanged here.

    CONNECTION_CLASSES in TableauConnectionClassConverter also stays private. 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 the conftest.py changes for the connected-app runs are left out.

  • No committed UI schema bundles. Main commits ui/public/jsons/connectionSchemas/** and ui/src/jsons/ingestionSchemas/**. 2.0 gitignores ui/src/jsons/* and builds it from the spec with parse-schema, so the 2.0 form gets the new authType from the schema change.

  • No 401 hint on 2.0. TSC 0.40 raises FailedSignInError for every 401, and 2.0's _status_of matches only ServerResponseError. 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_of match XMLError on main; it is not on 2.0, and this backport does not bring it.

    • The connected-app 401 test and the 401 case of the PAT-hints test are therefore left out.
    • Connected-app sign-in works and is tested, and so are the owner and data-model hints.
  • test_connection.py imports TableauConnectionConfig. 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[...] and Dict[...].

    • client.py takes main's tableau_server_auth: Credentials.
    • connection.py takes main's imports and -> Credentials. That return type replaces 2.0's Dict[str, Dict[str, Any]], so Dict and Any leave the typing import.
    • build_server_config keeps 2.0's connection: TableauConnectionConfig. Main's also accepts TableauPipelineConnection.
  • 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:read and tableau: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.py is 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 with json2ts.sh: tableauConnectedAppAuth.ts, tableauConnection.ts and serviceConnection.ts. All three are byte-identical to the committed ones.

Type of change:

  • New feature

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.

  • The new oneOf branch is additive.
  • Basic and PAT connections behave as before.
  • No migration is needed, because stored connections keep their auth types.

Tests:

Run locally on this branch, with:

  • 2.0's own generated models;
  • CI's pinned pytest==7.0.1;
  • tableauserverclient==0.40, 2.0's pin.

Use cases covered

  • A Tableau dashboard connection with TableauConnectedAppAuth builds a direct-trust JWT and signs in with TSC.JWTAuth and the site. The JWT has:
    • an HS256 signature and a kid/iss header;
    • iss, sub, aud and scp claims;
    • a 5-minute exp, and a new jti for each sign-in.
  • For a connected app, the owner and data-model test-connection hints name what is specific to connected apps. PAT connections keep their hints.
  • The server types a raw connected-app authType map as TableauConnectedAppAuth, so its secret is masked and encrypted.

Unit tests

  • Fixes 33371: Tableau connected app (direct trust JWT) sign-in #37084's unit tests, minus the pipeline and 401 cases listed above.
  • Affected tests. These are the changed tests plus every test that imports a changed module: test_connection.py 42, test_tableau.py 53, test_tableau_backfill.py 9, test_tableau_client.py 13 and test_tableau_redacted_upstream.py 9. 126 passed, 0 failed.
  • Every unit test file that mentions Tableau. This adds test_dashboard_owned_connection.py, test_source_parsing.py and test_workflow_parse.py, among others. 239 passed, both in one process and with -n 4 --dist loadfile.
  • Fail without the fix. With 2.0's original connection.py and client.py put back, the 4 new connected-app tests fail. The PAT-hints test passes, as it must.
  • Coverage. Every changed line that runs is covered: connection.py 20/20 and client.py 1/1. The one changed line not executed is the TYPE_CHECKING import of Credentials.
  • Java. mvn -o -pl openmetadata-service -am package -Dtest=TableauConnectionClassConverterTest gives BUILD SUCCESS: 1 test, 0 failures. spotless:check passes on openmetadata-service.
  • Static checks.
    • ruff check and ruff format --check pass with 2.0's config.
    • basedpyright (--baselinemode=discard, with tableauserverclient resolved) reports 0 errors on connection.py and client.py. Its baseline went down by 2 on these files.

Backend integration tests

Ingestion integration tests

Playwright (UI) tests

  • Not applicable: no UI code change. The connection form renders the new option from the schema.

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:

  1. Create a Tableau dashboard service and choose the connected-app authentication type.
  2. Enter the connected app's client ID, secret ID and secret value, and a Tableau username.
  3. Run test connection.
  4. Run metadata ingestion, and compare the result with a PAT service on the same site.

UI screen recording / screenshots:

Not applicable: no UI code change. The connection form renders the new authentication option from the schema.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>, with the backport suffix.
  • My PR is linked to a GitHub issue via Fixes #33371 above.
  • I have commented on my code, particularly in hard-to-understand areas. The comments are Fixes 33371: Tableau connected app (direct trust JWT) sign-in #37084's.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed. No migration is needed: the new oneOf branch is additive.
  • For UI changes: I attached a screen recording and/or screenshots above. Not applicable.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • Self-review against REVIEW.md. 64f2b54f1e7 was reviewed with fresh context against 2.0's REVIEW.md, and its amended successor 8d725708472 in a second pass, which found nothing.
    • Fixed: CONNECTION_CLASSES stays private (🟡).
    • Answered, not fixed — 🔴 the connected-app 401 rule cannot fire on 2.0. It needs fix(tableau): diagnose a failed sign-in, enforce schema/table dbServicePrefixes, skip lineage for a failed workbook #36691's _status_of change (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.
    • Answered, not fixed — 🟡 pipeline and integration references. The ADR body, the scope comment in connection.py and tests/utils/tableau_connected_app.py stay as on main (see Differences).

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 4/5

No behavioral blocker was found, but the Java test must meet the repository’s explicit requirements before merging.

Findings

  1. P2 Test breaks Java style requirements ▶

Summary

Adds connected-app sign-in to the Tableau dashboard connector on 2.0.

  • Tableau dashboard connections can sign in with a connected app.

Acknowledged choices from harshsoni2024:

  • The connected-app 401 hint cannot fire on 2.0; the required error-type change is outside this backport.
  • Pipeline and integration references remain to match the original change.
  • All twelve scopes remain intentionally, including pipeline and write scopes.

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]
Loading

Reviews (1) · Last reviewed commit: "chore(tableau): adapt the connected app ..." · Reviewed by Greptile

akashverma0786 and others added 2 commits November 23, 2026 16:38
* 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.
@harshsoni2024
harshsoni2024 requested review from a team as code owners November 23, 2026 11:48
@harshsoni2024 harshsoni2024 added the safe to test Add this label to run secure Github workflows on PRs label Nov 23, 2026
@harshsoni2024
harshsoni2024 requested review from TeddyCr, anuj-kumary and stout-yeoman and removed request for a team November 23, 2026 11:48
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@gitar-bot

gitar-bot Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved 🔴 High risk

Adding 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.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

Comment on lines +30 to +35
TableauConnection connection =
(TableauConnection)
ClassConverterFactory.getConverter(TableauConnection.class).convert(CONNECTION);

TableauConnectedAppAuth auth =
assertInstanceOf(TableauConnectedAppAuth.class, connection.getAuthType());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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!

@harshsoni2024
harshsoni2024 merged commit 65efbed into 2.0 Nov 23, 2026
84 of 89 checks passed
@harshsoni2024
harshsoni2024 deleted the backport-37084-2.0 branch November 23, 2026 13:04
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.

2 participants