Skip to content

[CXH-2028] - Support workload identity federation - Databricks Connector - #98

Merged
ggreer merged 10 commits into
mainfrom
ggreer/workload-identity
Nov 23, 2026
Merged

ggreer merged 10 commits into
mainfrom
ggreer/workload-identity

Conversation

@ggreer

@ggreer ggreer commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Description

  • Bug fix
  • New feature

The connector can now authenticate a Databricks service principal with workload identity federation. The client secret stays the default. Existing deployments keep working, and a saved config that sets the client secret still passes validation.

This pull request carries the six commits from #84 and adds the hosted path on top of them. #84 shipped two methods: the client secret and an externally issued JWT read from a file. It left the ConductorOne-hosted method out on purpose, because ConductorOne did not mint the JWT yet. ductone/c1#29994 adds that minting under CXE-1557, so the third method lands here. #84 is closed in favor of this pull request.

This pull request closes CXH-2028 and delivers the connector half of CXE-1557.

Decision path, before:

flowchart LR
  id["--databricks-client-id"]
  sec["--databricks-client-secret"]
  id --> cc["OAuth client credentials"]
  sec --> cc
  cc --> ep["account token endpoint"]
  ep --> bearer["Bearer token"]
  style sec fill:#e2e3e5,stroke:#6c757d,color:#000
  style bearer fill:#d1e7dd,stroke:#0f5132,color:#000
Loading

Decision path, after:

flowchart LR
  id["--databricks-client-id<br/>(required)"]
  pick{"--auth-method"}
  sec["client-secret (default)<br/>--databricks-client-secret"]
  file["workload-identity-file<br/>CLI and service mode<br/>--databricks-oidc-token-file"]
  c1["workload-identity-c1<br/>hosted only<br/>JWT from ConductorOne"]
  id --> pick
  pick --> sec
  pick --> file
  pick --> c1
  sec --> cc["OAuth client credentials"]
  file --> ex["RFC 8693 token exchange"]
  c1 --> ex
  cc --> ep["account token endpoint"]
  ex --> ep
  ep --> bearer["Bearer token"]
  style sec fill:#e2e3e5,stroke:#6c757d,color:#000
  style file fill:#d1e7dd,stroke:#0f5132,color:#000
  style c1 fill:#d1e7dd,stroke:#0f5132,color:#000
  style ex fill:#d1e7dd,stroke:#0f5132,color:#000
  style bearer fill:#d1e7dd,stroke:#0f5132,color:#000
Loading

Where the check runs:

flowchart LR
  cfg["pkg/config/config.go<br/>three field groups"]
  nc["pkg/connector/connector.go<br/>NewConnector"]
  pca["pkg/connector/connector.go<br/>prepareClientAuth"]
  fsrc["pkg/databricks/auth.go<br/>FileSubjectTokenSource"]
  csrc["pkg/databricks/auth.go<br/>OAuth2TokenSubjectTokenSource"]
  tf["pkg/databricks/auth.go<br/>TokenFederation.Token"]
  cfg --> nc
  nc --> pca
  pca --> fsrc
  pca --> csrc
  fsrc --> tf
  csrc --> tf
  style csrc fill:#d1e7dd,stroke:#0f5132,color:#000
Loading

Sync:

Unchanged. No resource type, entitlement or grant moves. This pull request changes only how the connector obtains its token.

Provisioning:

Unchanged. Account create and delete, group membership and role assignment all keep the behaviour they have today, including the GrantAlreadyExists and GrantAlreadyRevoked annotations.

Auth:

The connector still authenticates as the service principal named by --databricks-client-id. That flag stays required.

Three authentication methods are now available. The method selects the credential, and each method is a field group:

  • client-secret (default): --databricks-client-secret. The connector runs the OAuth client credentials flow. This is what every deployment uses today.
  • workload-identity-file (command line and service mode): --databricks-oidc-token-file. The connector reads this file on every token refresh.
  • workload-identity-c1 (ConductorOne-hosted only): no credential field. ConductorOne mints the JWT and delivers it to the connector runtime.

On the command line, select a method with --auth-method. Without it the connector validates against the default method and asks for a client secret.

Validation only checks the fields the selected group lists. The secret is not asked for when a workload identity method is chosen, and the other way round.

This is not a breaking change. No new flag is required, and the default group is unchanged.

Databricks must trust the JWT. The administrator creates a service principal federation policy on the same service principal. For the hosted method, ConductorOne signs the JWT and the policy must trust these values:

Policy value What ConductorOne sends
Issuer (iss) <tenant endpoint>/auth/v1/workload-identity
OIDC discovery <issuer>/.well-known/openid-configuration
JWKS <issuer>/jwks
Subject (sub) c1:tenant/<tenant id>/app/<app id>/connector/<connector id>
Audience (aud) the Databricks OAuth client ID
JWT lifetime 10 minutes
Signature RS256, from the tenant's WORKLOAD_IDENTITY_V1 signer family

Source: ductone/c1#29994, pkg/workloadidentity/workloadidentity.go and pkg/services/vault/workload_identity.go.

The hosted method also needs the WORKLOAD_IDENTITY_OIDC_ISSUER feature flag on the tenant. ConductorOne refuses to mint a token without it.

The exchange is RFC 8693. The grant type is urn:ietf:params:oauth:grant-type:token-exchange. The subject token type is urn:ietf:params:oauth:token-type:jwt. The scope is all-apis. The URL is the account token endpoint that the client secret already uses.

Architecture highlights:

  • The token source is custom. clientcredentials.Config can override grant_type, but its public API caches the token before the connector can set an expiry. A missing expires_in would pin the first token for the life of the process.
  • A missing expires_in falls back to the access token exp claim, then to five minutes.
  • The JWT lookup sits behind SubjectTokenSource. TokenFederation.Token() asks the source for a subject token on every exchange, so a rotated credential needs no restart. There are two implementations: the file and the ConductorOne token source.
  • databricks-c1-token is an OAuth2-typed field that holds nothing an operator sets. The hosted runtime attaches its oauth2.TokenSource only when the selected field group contains an OAuth2 field, so the field is what turns the hosted delivery on.
  • The hosted method fails closed. NewConnector returns an error when the method is selected and the runtime supplies no token source, so the connector cannot fall back to an empty client secret.
  • A rejected exchange keeps a gRPC code. uhttp classifies the HTTP status. An HTTP 200 with no access token returns FailedPrecondition.

Validation:

Measured on #84's branch, which carries the same six commits:

  • Client secret: full sync against the Baton Databricks account. Exit 0, 0 connector errors.
  • Federation with a token file: a temporary policy with an inline JWKS on service principal baton-uc-cxh2341, then a full sync with no client secret. The result matched the client secret sync exactly: 322 resources, 279 entitlements, 789 grants. The policy and the test key were deleted after the run.
  • An expired JWT, a JWT signed by an untrusted key and a missing file are each refused. Restoring the file syncs again.
  • A 75-second JWT failed the sync when the file was not rotated. It passed when the file was rotated mid-sync.
  • Service mode against a Squire tenant: Hello succeeded for both credential types.

Reported on this branch by @carolinaroncaglia: a full sync against a real Databricks account works for both client-secret and workload-identity-file, with 0 connector errors.

The workload-identity-c1 path is not validated yet. It needs this pull request and ductone/c1#29994 both merged and deployed to a publicly reachable instance.

Useful links:

Dependency

This pull request and ductone/c1#29994 are independent at build time. The connector compiles and syncs without the c1 change, and the two non-hosted methods work on their own. The hosted method only works after both merge and deploy.

mateoHernandez123 and others added 8 commits November 19, 2026 17:02
Co-authored-by: Cursor <cursoragent@cursor.com>
…mselves

Co-authored-by: Cursor <cursoragent@cursor.com>
…they carry

databricks-token reads as a Databricks personal access token: that is what
DATABRICKS_TOKEN means in Databricks' own tooling, and what a bare token field
means across the connectors. This credential is an externally issued JWT, which
Databricks itself calls DATABRICKS_OIDC_TOKEN, so the flags are now
databricks-oidc-token and databricks-oidc-token-file. Nothing ships with the old
names yet, so no deployed configuration changes.

The Kubernetes example also promised a token file that nothing created: the
secret pointed the token file at /var/run/secrets/databricks/token while the
Deployment below mounted no such volume, so the first exchange failed unless the
operator supplied the mount themselves. It now carries the matching projected
serviceAccountToken volume and mount, commented out like the secret line it
pairs with.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The exported config schema gave neither workload identity field an export
target, so both reached the hosted web form, and neither works there. A hosted
connector has no file system the tenant admin controls, and a pasted JWT is
never refreshed: Token() asks for a fresh subject token on every exchange, so a
static string returns the same expired JWT once its hour is up. The Hello check
runs while that JWT is still valid, so the configuration validates and the sync
breaks later.

Field groups replace the mutually exclusive and at-least-one constraints. The
client secret is the default and is required again, which the constraints had
forced off. The token file is its own CLI-only group, so hosted no longer
offers it. The static token field is removed: it works in neither mode.

Validation skips any field the selected group does not list, so each group
repeats the common fields; account-id is required and would otherwise stop
being checked. Selecting the file method on the command line needs
--auth-method, which the README now shows.

The JWT lookup moves behind SubjectTokenSource, with the file as its only
implementation. A source that reads from ConductorOne lands when CXE-1557 adds
the minting, and Token() will not change.

Verified against the tenant with a temporary federation policy carrying an
inline JWKS: a locally signed JWT exchanged for a Databricks token, and the
sync through it matched the client-secret sync exactly (322 resources, 279
entitlements, 789 grants). An expired JWT, a JWT signed by an untrusted key and
a missing file are each refused, and restoring the file syncs again, which is
the rotation the source exists for. The policy was deleted afterwards.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…edential

prepareClientAuth switched to federation whenever a token file was set, so a
file left over from another deployment replaced the credential the operator
had selected, and validation did not catch it: the file is not in the client
secret group, so that group never checks it. The method is the explicit
choice, so the branch reads it. The group names move to constants that both
the group definitions and the branch share.

The Kubernetes example set BATON_DATABRICKS_OIDC_TOKEN_FILE without
BATON_AUTH_METHOD, which validates against the client secret group and fails
on the missing secret, so copying it produced a deployment that could not
start. Both variables are now shown together.

docs-info.md still described the JWT as a value or a file path, and two lines
still said exactly one of two credentials is supplied. The static value is
gone and the method selects the credential.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…dentity-c1 method

The workload-identity-c1 group selected the hosted runtime's token source, but
prepareClientAuth only branched on the token file method, so the connector fell
through to client credentials with an empty secret and Databricks refused it
with invalid_client.

The method now exchanges the JWT the runtime supplies, through a
SubjectTokenSource over the runtime's oauth2.TokenSource. Constructing the
connector under this method without a token source is an error, so it cannot
fall back to the client secret path.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ggreer
ggreer requested a review from a team November 20, 2026 21:19
@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor
Superseded — see the current review report for commit f5088d503279

Connector PR Review: Workload identity support

Blocking Issues: 0 | Suggestions: 1 | Threads Resolved: 0
Criteria: Criteria status: loaded .claude/skills/ci-review.md from trusted base 81c5629d9ea7.
Review mode: full
View review run

Review Summary

This PR adds RFC 8693 workload identity federation as an alternative to the OAuth client secret. The auth method is chosen through SDK field groups:

  • client-secret is the default.
  • workload-identity-file is CLI only and reads the JWT from a file again on every refresh.
  • workload-identity-c1 is for a ConductorOne-hosted connector, which gets the JWT from opts.TokenSource.

NewConnector now validates the config against the selected group. The exchange goes through uhttp.BaseHttpClient with a 30s timeout and sets a non-zero expiry, and its errors come back with gRPC codes (429/5xx → Unavailable, which matches E2). I scanned the full diff for security and correctness. I applied the repo-local criteria wherever they were relevant: E1/E2 (error codes), H1/H5 (the response body is closed after the error check, and uhttp does not log the request body that carries the subject token), G1–G4 (config fields and conf.gen.go), and D1–D4 (stale docs). Section S and the provisioning and pagination rules don't apply, because no List/Entitlements/Grants or Grant/Revoke code changed. go.mod and go.sum did not change; the vendored baton-sdk v0.46.0 already provides field groups and WithAuthMethod.

Security Issues

None found.

Correctness Issues

None found.

Suggestions

  • New — README.md:123-126, docs/connector.mdx (the <Warning> under "Authentication methods") and docs/docs-info.md say workload identity is not offered to hosted connectors and is "tracked in CXE-1557". The latest commit adds the workload-identity-c1 group, and config_schema.json now exposes it. Nothing in the docs explains how to set up that method's federation policy. (D1/D3, confidence: high)
  • The doc comment on NewTokenFederation (pkg/databricks/auth.go) still says "Exactly one of token or tokenFile". The function now takes a SubjectTokenSource, so the comment is out of date. Minor, and folded into this one suggestion.
Prompt for AI agents
Verify each finding against the current code and only fix it if needed.

## Suggestions

In `README.md`:
- Around line 123-126: Remove the claim that a ConductorOne-hosted connector cannot use workload identity and the "tracked in CXE-1557" note. Add a subsection describing the `workload-identity-c1` method: ConductorOne issues the JWT, and the Databricks service principal federation policy must trust ConductorOne's issuer and subject, with the audience set to the OAuth client ID.

In `docs/connector.mdx`:
- The <Warning> under "Authentication methods": Update it the same way. Say that hosted connectors can use workload identity (ConductorOne) and that the token file option is only for self-hosted connectors.

In `docs/docs-info.md`:
- Answer 1: Drop "available only when you run the connector yourself" and describe the hosted ConductorOne-issued JWT option.

In `pkg/databricks/auth.go`:
- NewTokenFederation doc comment: Replace "Exactly one of token or tokenFile carries the JWT" with a description of the SubjectTokenSource parameter.

Comment thread README.md Outdated
Comment on lines +123 to +126
This method runs the connector yourself: on the command line or in service mode.
A ConductorOne-hosted connector has no file system you control, so the option is
not offered there. Hosted support needs ConductorOne to issue the JWT, which is
tracked in CXE-1557.

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.

🟡 Suggestion: This paragraph says hosted support is not offered and is still tracked in CXE-1557. The same PR adds the workload-identity-c1 group, which config_schema.json exposes to hosted tenants. The <Warning> in docs/connector.mdx and docs/docs-info.md say the same thing. Please document the ConductorOne method, including what the federation policy must trust (audience = OAuth client ID), and remove the "not offered" wording. (confidence: high)

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor
Superseded — see the current review report for commit f017bd2da750

Connector PR Review: Workload identity support

Blocking Issues: 0 | Suggestions: 1 | Threads Resolved: 0
Criteria: Criteria status: loaded .claude/skills/ci-review.md from trusted base 81c5629d9ea7.
Review mode: full
View review run

Review Summary

This PR adds RFC 8693 workload identity federation as an alternative to the OAuth client secret. The auth method is chosen through SDK field groups:

  • client-secret is the default.
  • workload-identity-file is CLI only and reads the JWT from a file again on every refresh.
  • workload-identity-c1 is for a ConductorOne-hosted connector, which gets the JWT from opts.TokenSource.

NewConnector now validates the config against the selected group. The exchange goes through uhttp.BaseHttpClient with a 30s timeout and sets a non-zero expiry, and its errors come back with gRPC codes (429/5xx → Unavailable, which matches E2). I scanned the full diff for security and correctness. I applied the repo-local criteria wherever they were relevant: E1/E2 (error codes), H1/H5 (the response body is closed after the error check, and uhttp does not log the request body that carries the subject token), G1–G4 (config fields and conf.gen.go), and D1–D4 (stale docs). Section S and the provisioning and pagination rules don't apply, because no List/Entitlements/Grants or Grant/Revoke code changed. go.mod and go.sum did not change; the vendored baton-sdk v0.46.0 already provides field groups and WithAuthMethod.

Security Issues

None found.

Correctness Issues

None found.

Suggestions

  • New — README.md:123-126, docs/connector.mdx (the <Warning> under "Authentication methods") and docs/docs-info.md say workload identity is not offered to hosted connectors and is "tracked in CXE-1557". The latest commit adds the workload-identity-c1 group, and config_schema.json now exposes it. Nothing in the docs explains how to set up that method's federation policy. (D1/D3, confidence: high)
  • The doc comment on NewTokenFederation (pkg/databricks/auth.go) still says "Exactly one of token or tokenFile". The function now takes a SubjectTokenSource, so the comment is out of date. Minor, and folded into this one suggestion.
Prompt for AI agents
Verify each finding against the current code and only fix it if needed.

## Suggestions

In `README.md`:
- Around line 123-126: Remove the claim that a ConductorOne-hosted connector cannot use workload identity and the "tracked in CXE-1557" note. Add a subsection describing the `workload-identity-c1` method: ConductorOne issues the JWT, and the Databricks service principal federation policy must trust ConductorOne's issuer and subject, with the audience set to the OAuth client ID.

In `docs/connector.mdx`:
- The <Warning> under "Authentication methods": Update it the same way. Say that hosted connectors can use workload identity (ConductorOne) and that the token file option is only for self-hosted connectors.

In `docs/docs-info.md`:
- Answer 1: Drop "available only when you run the connector yourself" and describe the hosted ConductorOne-issued JWT option.

In `pkg/databricks/auth.go`:
- NewTokenFederation doc comment: Replace "Exactly one of token or tokenFile carries the JWT" with a description of the SubjectTokenSource parameter.

Reviewed commit: f5088d503279

@github-actions github-actions Bot left a comment

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.

No blocking issues found — see the full review report

@mateoHernandez123 mateoHernandez123 changed the title Workload identity support [CXH-2028] - Support workload identity federation - Databricks Connector Nov 23, 2026
@linear-code

linear-code Bot commented Nov 23, 2026

Copy link
Copy Markdown

CXH-2028

@mateoHernandez123 mateoHernandez123 left a comment

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.

Five notes inline: two measured against this branch, three on the documentation the hosted method still needs.

Comment thread pkg/databricks/auth.go Resolved
Comment thread pkg/databricks/auth.go Resolved
Comment thread docs/connector.mdx Resolved
Comment thread README.md Resolved
Comment thread docs/docs-info.md Resolved
main added sql-warehouse-id (#97) while this branch added the auth field groups,
so both touched the same var block in pkg/config/config.go and the import block
in pkg/connector/connector.go.

Both sides are kept. sql-warehouse-id joins commonFields: it applies whichever
way the connector authenticates, and a field that is in no group is exported in
no method's schema, so incremental sync would otherwise be unreachable from the
hosted form. config_schema.json is regenerated with ./connector config.

Build, vet, test and lint are clean. A full sync against the tenant matches both
parents exactly: 12 resource types, 326 resources, 282 entitlements, 759 grants,
0 connector errors.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor
Superseded — see the current review report for commit f017bd2da750

Connector PR Review: [CXH-2028] - Support workload identity federation - Databricks Connector

Blocking Issues: 0 | Suggestions: 2 | Threads Resolved: 0
Criteria: Criteria status: loaded .claude/skills/ci-review.md from trusted base 3904b1727d62.
Review mode: full
View review run

Review Summary

The PR adds three auth field groups: client-secret (the default), workload-identity-file (CLI and service mode only) and workload-identity-c1 (hosted, through a hidden OAuth2 field). The connector chooses its credential from opts.SelectedAuthMethod. Both workload identity methods exchange a JWT through a custom RFC 8693 token source built on uhttp.BaseHttpClient, with an expiry fallback so a missing expires_in cannot pin the token. The hosted method fails closed when the runtime supplies no token source.

I scanned the full PR diff for security and correctness. I also checked that the vendored baton-sdk exposes SelectedAuthMethod/TokenSource and attaches the hosted token source only when the group contains an OAuth2 field (lambda_server__added.go:507).

How the trusted criteria applied:

  • E1/E2: satisfied. Exchange errors go through uhttp, so 429 and 5xx stay Unavailable. Hand-wrapped errors use sensible codes.
  • H1/H5: satisfied. The body is closed after the error check, and no secrets reach logs. The JWT is never logged, and the file path in errors is not a secret.
  • BP1: satisfied. The default group is unchanged, so this is not a breaking change.
  • Not applicable: sync, provisioning and span rules, because no List, Grants or Grant/Revoke code changed.

Security Issues

None found.

Correctness Issues

None found.

Suggestions

  • Prior — still present (doc staleness D1/D3): hosted workload identity is still described as unavailable.
    • README.md:123-126, the <Warning> at docs/connector.mdx:57 and docs/docs-info.md:21 all say so; the README adds that it is "tracked in CXE-1557".
    • The PR adds the workload-identity-c1 group, which config_schema.json exposes.
    • No doc explains the hosted federation policy (issuer, subject, audience).
    • The doc comment on NewTokenFederation (pkg/databricks/auth.go:219) still mentions "token or tokenFile". (confidence: high)
  • New: README.md:92-93 says "Passing more than one is a configuration error". The code doesn't reject that case: prepareClientAuth follows the selected auth method and ignores leftover credential fields, and pkg/connector/auth_selection_test.go checks for exactly that behavior. (confidence: high)
Prompt for AI agents
Verify each finding against the current code and only fix it if needed.

## Suggestions

In `README.md`:
- Around line 123-126: Remove the claim that a ConductorOne-hosted connector cannot use workload identity, along with the "tracked in CXE-1557" note. Add a subsection for the `workload-identity-c1` method: ConductorOne issues the JWT, and the Databricks service principal federation policy must trust ConductorOne's issuer (`<tenant endpoint>/auth/v1/workload-identity`) and subject (`c1:tenant/<tenant id>/app/<app id>/connector/<connector id>`), with the audience set to the OAuth client ID. Apply the same update to the `<Warning>` in `docs/connector.mdx` (around line 57) and to `docs/docs-info.md` (around line 21, "one of two ways").
- Around line 92-93: Replace "Exactly one of the following credentials must be supplied. Passing more than one is a configuration error." with text saying that `--auth-method` selects the credential and that fields for other methods are ignored. This matches prepareClientAuth.

In `pkg/databricks/auth.go`:
- Around line 219: Update the NewTokenFederation doc comment. It now takes a SubjectTokenSource, not "token or tokenFile".

Comment thread README.md Outdated
Comment on lines +92 to +93
Exactly one of the following credentials must be supplied. Passing more than one
is a configuration error.

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.

🟡 Suggestion: This says passing more than one credential is a configuration error. The code doesn't reject it: prepareClientAuth (pkg/connector/connector.go) follows --auth-method and ignores any leftover credential field, and auth_selection_test.go checks for exactly that. Suggest rewording to something like "--auth-method selects which credential is used; fields for other methods are ignored." (confidence: high)

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor
Superseded — see the current review report for commit fc9dcc81a620

Connector PR Review: [CXH-2028] - Support workload identity federation - Databricks Connector

Blocking Issues: 0 | Suggestions: 2 | Threads Resolved: 0
Criteria: Criteria status: loaded .claude/skills/ci-review.md from trusted base 3904b1727d62.
Review mode: full
View review run

Review Summary

The PR adds three auth field groups: client-secret (the default), workload-identity-file (CLI and service mode only) and workload-identity-c1 (hosted, through a hidden OAuth2 field). The connector chooses its credential from opts.SelectedAuthMethod. Both workload identity methods exchange a JWT through a custom RFC 8693 token source built on uhttp.BaseHttpClient, with an expiry fallback so a missing expires_in cannot pin the token. The hosted method fails closed when the runtime supplies no token source.

I scanned the full PR diff for security and correctness. I also checked that the vendored baton-sdk exposes SelectedAuthMethod/TokenSource and attaches the hosted token source only when the group contains an OAuth2 field (lambda_server__added.go:507).

How the trusted criteria applied:

  • E1/E2: satisfied. Exchange errors go through uhttp, so 429 and 5xx stay Unavailable. Hand-wrapped errors use sensible codes.
  • H1/H5: satisfied. The body is closed after the error check, and no secrets reach logs. The JWT is never logged, and the file path in errors is not a secret.
  • BP1: satisfied. The default group is unchanged, so this is not a breaking change.
  • Not applicable: sync, provisioning and span rules, because no List, Grants or Grant/Revoke code changed.

Security Issues

None found.

Correctness Issues

None found.

Suggestions

  • Prior — still present (doc staleness D1/D3): hosted workload identity is still described as unavailable.
    • README.md:123-126, the <Warning> at docs/connector.mdx:57 and docs/docs-info.md:21 all say so; the README adds that it is "tracked in CXE-1557".
    • The PR adds the workload-identity-c1 group, which config_schema.json exposes.
    • No doc explains the hosted federation policy (issuer, subject, audience).
    • The doc comment on NewTokenFederation (pkg/databricks/auth.go:219) still mentions "token or tokenFile". (confidence: high)
  • New: README.md:92-93 says "Passing more than one is a configuration error". The code doesn't reject that case: prepareClientAuth follows the selected auth method and ignores leftover credential fields, and pkg/connector/auth_selection_test.go checks for exactly that behavior. (confidence: high)
Prompt for AI agents
Verify each finding against the current code and only fix it if needed.

## Suggestions

In `README.md`:
- Around line 123-126: Remove the claim that a ConductorOne-hosted connector cannot use workload identity, along with the "tracked in CXE-1557" note. Add a subsection for the `workload-identity-c1` method: ConductorOne issues the JWT, and the Databricks service principal federation policy must trust ConductorOne's issuer (`<tenant endpoint>/auth/v1/workload-identity`) and subject (`c1:tenant/<tenant id>/app/<app id>/connector/<connector id>`), with the audience set to the OAuth client ID. Apply the same update to the `<Warning>` in `docs/connector.mdx` (around line 57) and to `docs/docs-info.md` (around line 21, "one of two ways").
- Around line 92-93: Replace "Exactly one of the following credentials must be supplied. Passing more than one is a configuration error." with text saying that `--auth-method` selects the credential and that fields for other methods are ignored. This matches prepareClientAuth.

In `pkg/databricks/auth.go`:
- Around line 219: Update the NewTokenFederation doc comment. It now takes a SubjectTokenSource, not "token or tokenFile".

Reviewed commit: f017bd2da750

@github-actions github-actions Bot left a comment

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.

No blocking issues found — see the full review report

…en, document hosted workload identity

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor
Superseded — see the current review report for commit fc9dcc81a620

Connector PR Review: [CXH-2028] - Support workload identity federation - Databricks Connector

Blocking Issues: 0 | Suggestions: 0 | Threads Resolved: 0
Criteria: Criteria status: loaded .claude/skills/ci-review.md from trusted base 3904b1727d62.
Review mode: incremental since f017bd2
View review run

Review Summary

The new commit makes three changes:

  • Error codes: OAuth2TokenSubjectTokenSource.SubjectToken (pkg/databricks/auth.go:97-113) now passes through any gRPC status the ConductorOne token source returns, so Unavailable and DeadlineExceeded stay retryable. Errors without a status are wrapped as FailedPrecondition.
  • Nil token: a nil *oauth2.Token is now refused instead of causing a panic. A table test covers both changes.
  • Docs: the README, docs/connector.mdx and docs/docs-info.md now describe the hosted workload-identity-c1 method and its federation policy values.

I scanned the full PR diff for security and correctness. The scope covered:

  • auth selection in NewConnector and prepareClientAuth, including the fail-closed check when no hosted token source is supplied
  • the field groups in pkg/config/config.go
  • the RFC 8693 exchange through uhttp.BaseHttpClient

No sync, provisioning or span code changed.

The repo-local criteria were applied:

  • E1/E2: pass-through statuses match what uhttp would produce, and the hand-wrapped codes are sensible.
  • H1/H2: the body is closed after the error check.
  • H5: no secrets appear in logs or errors.
  • S, T and PR rules: not applicable, because no List, Entitlements, Grants or Grant/Revoke code changed.
  • Breaking-change gate: client-secret stays the default group, so existing configs are unaffected.

The incremental diff was complete, with no dropped paths.

Security Issues

None found.

Correctness Issues

None found.

Suggestions

None.

Resolved prior findings

  • Fixed: the README said hosted workload identity was not offered and was "tracked in CXE-1557". README.md:124-126, docs/connector.mdx:52,58, the new "C1-hosted connectors" section in docs/connector.mdx, and docs/docs-info.md ("one of three ways") now document the hosted method and its policy values.
  • Fixed: the README said "passing more than one credential is a configuration error". README.md:92-93 now says --auth-method selects the credential and fields for other methods are ignored, which matches prepareClientAuth (pkg/connector/connector.go:219-251).
  • Fixed: the stale "token or tokenFile" doc comment. pkg/databricks/auth.go:226-227 now describes the SubjectTokenSource.

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Connector PR Review: [CXH-2028] - Support workload identity federation - Databricks Connector

Blocking Issues: 0 | Suggestions: 0 | Threads Resolved: 0
Criteria: Criteria status: loaded .claude/skills/ci-review.md from trusted base 3904b1727d62.
Review mode: incremental since f017bd2
View review run

Review Summary

The new commit makes three changes:

  • Error codes: OAuth2TokenSubjectTokenSource.SubjectToken (pkg/databricks/auth.go:97-113) now passes through any gRPC status the ConductorOne token source returns, so Unavailable and DeadlineExceeded stay retryable. Errors without a status are wrapped as FailedPrecondition.
  • Nil token: a nil *oauth2.Token is now refused instead of causing a panic. A table test covers both changes.
  • Docs: the README, docs/connector.mdx and docs/docs-info.md now describe the hosted workload-identity-c1 method and its federation policy values.

I scanned the full PR diff for security and correctness. The scope covered:

  • auth selection in NewConnector and prepareClientAuth, including the fail-closed check when no hosted token source is supplied
  • the field groups in pkg/config/config.go
  • the RFC 8693 exchange through uhttp.BaseHttpClient

No sync, provisioning or span code changed.

The repo-local criteria were applied:

  • E1/E2: pass-through statuses match what uhttp would produce, and the hand-wrapped codes are sensible.
  • H1/H2: the body is closed after the error check.
  • H5: no secrets appear in logs or errors.
  • S, T and PR rules: not applicable, because no List, Entitlements, Grants or Grant/Revoke code changed.
  • Breaking-change gate: client-secret stays the default group, so existing configs are unaffected.

The incremental diff was complete, with no dropped paths.

Security Issues

None found.

Correctness Issues

None found.

Suggestions

None.

Resolved prior findings

  • Fixed: the README said hosted workload identity was not offered and was "tracked in CXE-1557". README.md:124-126, docs/connector.mdx:52,58, the new "C1-hosted connectors" section in docs/connector.mdx, and docs/docs-info.md ("one of three ways") now document the hosted method and its policy values.
  • Fixed: the README said "passing more than one credential is a configuration error". README.md:92-93 now says --auth-method selects the credential and fields for other methods are ignored, which matches prepareClientAuth (pkg/connector/connector.go:219-251).
  • Fixed: the stale "token or tokenFile" doc comment. pkg/databricks/auth.go:226-227 now describes the SubjectTokenSource.

Reviewed commit: fc9dcc81a620

@github-actions github-actions Bot left a comment

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.

No blocking issues found — see the full review report

@mateoHernandez123

Copy link
Copy Markdown
Contributor

The five notes I left are fixed on fc9dcc8.

I synced this binary against our Databricks account with the client secret. Exit 0, 0 connector errors: 12 resource types, 326 resources, 282 entitlements, 759 grants. Same totals as the merge commit's run against both parents.

The hosted method still needs the ConductorOne runtime. c1#29994 is merged; this command-line run covers the client-secret path.

@mateoHernandez123 mateoHernandez123 left a comment

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.

Approving. The review notes are addressed on fc9dcc8 and the tenant sync matches the previous run.

@ggreer
ggreer merged commit 0540f95 into main Nov 23, 2026
10 checks passed
@ggreer
ggreer deleted the ggreer/workload-identity branch November 23, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants