Add supplied-token OIDC federation to the Databricks provider - #69272
Merged
kaxil merged 2 commits intoJul 8, 2026
Conversation
Add a `federated_token_provider` connection extra: a dotted-path callable that supplies a short-lived OIDC JWT in-process, which the hook exchanges for a Databricks OAuth token via the same RFC 8693 endpoint the `federated_k8s` path uses. Works with any federation-trusted issuer and in any environment, not only Kubernetes. `client_id` is optional (account-wide policy) or supplied (service principal policy). The Kubernetes federation path is behaviourally unchanged.
phanikumv
reviewed
Jul 3, 2026
Address review: validate the federated_token_provider return on its stripped value and return the stripped token, so a whitespace-only token is rejected and a valid token with surrounding whitespace (e.g. a trailing newline) is normalised before the exchange -- matching the Kubernetes path, which already strips. Add whitespace-only and newline-padded test cases.
vincbeck
approved these changes
Jul 7, 2026
vincbeck
left a comment
Contributor
There was a problem hiding this comment.
Not too familiar wth Databricks ... But code looks okay to me
eladkal
approved these changes
Jul 7, 2026
Contributor
|
We have @moomindani from Databricks to verify if needed :) |
Contributor
|
Verified this PR against a real Databricks workspace, including the full happy path:
LGTM. Drafted-by: Claude Code (Fable 5); reviewed by @moomindani before posting |
1 task
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.
The Databricks provider can already federate an OIDC token into a Databricks OAuth token, but only from the pod's Kubernetes service account (
federated_k8s), read from disk. This adds a second subject-token source: afederated_token_providerconnection extra, a dotted path to aCallable[[], str]that returns the OIDC JWT in-process, which the hook exchanges for a Databricks OAuth token through the same RFC 8693 token-exchange endpoint thefederated_k8spath uses. No long-lived secret is stored, the subject token is never written to disk, and the source works in any environment (not only Kubernetes) with any issuer a Databricks federation policy trusts.Why a token provider callable
The subject token is a short-lived, per-workload OIDC JWT that has to be minted fresh at connect time, so a static value in the connection extra would not work (it would be a stored long-lived secret that never refreshes). A callable lets a control plane vend a fresh token per task, in-process. This mirrors the OpenAI provider's
token_providercustom source (#69069) and resolves the dotted path withimport_string, the same pattern other providers use for callables in connection config.Because the callable is imported and executed in the process running the hook, point it only at trusted code. The connection
extrais an operator/admin surface.Design notes
client_idis optional for this path: include it for a service principal federation policy, or omit it for an account-wide policy (an account-wide policy is what lets the issuer stamp a per-workload subject claim). The Kubernetes path is unchanged:client_idstays required (service account tokens cannot carry custom claims) and is still validated before the token is read.run_in_executor, so it cannot stall the triggerer event loop used by deferrable operators.requestscall to/oidc/v1/token, identical to the shipped Kubernetes path.token, Azure credentials, orservice_principal_oauth) is set on the connection.Usage
{ "conn_type": "databricks", "host": "my-workspace.cloud.databricks.com", "extra": { "federated_token_provider": "my_package.identity.get_oidc_token" } }Add
client_idfor a service principal federation policy; omit it for an account-wide policy.