Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 145
feat(kernel): forward identity federation client ID#910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 7ffb30d533c08651ca707b8dd13894c9e01cb68e | ||
| eff8950428f4e6cc9975c663ec919f334962f7d0 | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -21,6 +21,10 @@ | ||
| kernel's ``auth_type='oauth-u2m'`` and the kernel runs the browser | ||
| flow itself. | ||
| ``identity_federation_client_id`` is forwarded with whichever auth shape | ||
| wins resolution. It selects mandatory SP-wide workload-identity token | ||
| exchange in the kernel; omitting it preserves BYOT / account-wide behavior. | ||
| A user-supplied custom ``credentials_provider`` is **rejected** on the | ||
| kernel path with ``NotSupportedError``: it's an opaque token source | ||
| with no extractable raw credentials, so the kernel can't own the | ||
| @@ -125,10 +129,10 @@ def kernel_auth_kwargs( | ||
| ``auth_options`` carries the raw connect() kwargs relevant to auth | ||
| (``auth_type``, ``oauth_client_id``, ``oauth_client_secret``, | ||
| ``oauth_redirect_port``, ``credentials_provider``). They drive the | ||
| OAuth decisions because the OAuth secret is consumed during | ||
| ``AuthProvider`` construction and can't be read back off the built | ||
| provider. | ||
| ``oauth_redirect_port``, ``credentials_provider``, | ||
| ``identity_federation_client_id``). They drive the OAuth decisions | ||
| because the OAuth secret is consumed during ``AuthProvider`` | ||
| construction and can't be read back off the built provider. | ||
| Resolution order: | ||
| @@ -161,6 +165,7 @@ def kernel_auth_kwargs( | ||
| client_id = opts.get("oauth_client_id") | ||
| client_secret = opts.get("oauth_client_secret") | ||
| federation_client_id = opts.get("identity_federation_client_id") | ||
| auth_type = opts.get("auth_type") | ||
| has_m2m = bool(client_id and client_secret) | ||
| @@ -191,6 +196,8 @@ def kernel_auth_kwargs( | ||
| scopes = _normalize_scopes(opts.get("oauth_scopes")) | ||
| if scopes is not None: | ||
| kwargs["oauth_scopes"] = scopes | ||
| if federation_client_id: | ||
vuanhphung marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. vuanhphung marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| kwargs["identity_federation_client_id"] = federation_client_id | ||
| return kwargs | ||
| # 2. PAT (including TokenFederationProvider-wrapped PAT). | ||
| @@ -201,7 +208,10 @@ def kernel_auth_kwargs( | ||
| "PAT auth provider did not produce a Bearer Authorization " | ||
| "header; cannot route through the kernel's PAT path" | ||
| ) | ||
| return {"auth_type": "pat", "access_token": token} | ||
| kwargs = {"auth_type": "pat", "access_token": token} | ||
| if federation_client_id: | ||
| kwargs["identity_federation_client_id"] = federation_client_id | ||
| return kwargs | ||
| # 3. OAuth U2M — browser authorization-code flow; the kernel runs it. | ||
| if auth_type in ("databricks-oauth", "azure-oauth"): | ||
| @@ -214,6 +224,8 @@ def kernel_auth_kwargs( | ||
| scopes = _normalize_scopes(opts.get("oauth_scopes")) | ||
| if scopes is not None: | ||
| kwargs["oauth_scopes"] = scopes | ||
| if federation_client_id: | ||
| kwargs["identity_federation_client_id"] = federation_client_id | ||
| return kwargs | ||
| # 4. Custom credentials_provider — the connector's primary M2M path | ||
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
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
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
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
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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.
Uh oh!
There was an error while loading. Please reload this page.