Commit 2572362
committed
refactor(backend/kernel): PAT-only auth, drop External trampoline
The earlier auth_bridge routed OAuth/MSAL/federation through the
kernel's External token-provider trampoline (a Python callable
the kernel invoked per HTTP request). Removing that for now.
Why: routing OAuth into the kernel inherently requires per-request
token resolution to keep refresh working during a long-running
session. Two viable mechanisms (kernel-native OAuth, or the
External callback); both have costs (duplicate OAuth flows vs
GIL-per-request). Punting the decision until there's actual
demand on use_sea=True.
Today: the bridge accepts PAT (including TokenFederationProvider-
wrapped PAT, which is how `get_python_sql_connector_auth_provider`
always shapes it). Any non-PAT auth_provider raises a clear
NotSupportedError pointing the user at use_sea=False (Thrift).
This shrinks the auth_bridge to ~50 lines and means the kernel-
side External enablement PR is no longer on the connector's
critical path — there's no kernel-side prerequisite for shipping
use_sea=True for PAT users.
Unit tests updated:
- TokenFederationProvider-wrapped PAT still routes to PAT (kept).
- Generic OAuth provider raises NotSupportedError (new).
- ExternalAuthProvider raises NotSupportedError (new).
- Silent non-PAT provider raises NotSupportedError (new) —
reject the type itself rather than trying to extract a token
we already know we can't use.
Live e2e against dogfood with use_sea=True (PAT): all checks
still pass (SELECT 1, range(10000), fetchmany pacing, four
metadata calls, session_configuration round-trip, structured
DatabaseError on bad SQL).
Co-authored-by: Isaac
Signed-off-by: Vikrant Puppala <vikrant.puppala@databricks.com>1 parent 9259644 commit 2572362Copy full SHA for 2572362
2 files changed
+76-99Lines changed: 76 additions & 99 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- src/databricks/sql/backend/kernel
- tests/unit
Expand file treeCollapse file tree
Open diff view settings
Collapse file
src/databricks/sql/backend/kernel/auth_bridge.py
Copy file name to clipboard+22-56Lines changed: 22 additions & 56 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | 2 | |
3 | 3 | |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
11 | 10 | |
12 | 11 | |
13 | 12 | |
14 | | - |
15 | | - |
16 | | - |
17 | | - |
18 | | - |
19 | | - |
20 | | - |
21 | | - |
22 | | - |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
23 | 17 | |
24 | 18 | |
25 | 19 | |
| ||
29 | 23 | |
30 | 24 | |
31 | 25 | |
| 26 | + |
32 | 27 | |
33 | 28 | |
34 | 29 | |
| ||
64 | 59 | |
65 | 60 | |
66 | 61 | |
67 | | - |
68 | | - |
| 62 | + |
| 63 | + |
69 | 64 | |
70 | 65 | |
71 | 66 | |
| ||
80 | 75 | |
81 | 76 | |
82 | 77 | |
83 | | - |
84 | | - |
85 | | - |
86 | | - |
87 | | - |
88 | | - |
89 | | - |
90 | | - |
91 | | - |
92 | | - |
93 | | - |
94 | | - |
95 | | - |
96 | | - |
97 | | - |
98 | | - |
99 | | - |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
100 | 83 | |
101 | 84 | |
102 | | - |
103 | | - |
104 | | - |
105 | | - |
106 | 85 | |
107 | 86 | |
108 | 87 | |
| ||
111 | 90 | |
112 | 91 | |
113 | 92 | |
114 | | - |
115 | | - |
116 | | - |
117 | | - |
118 | | - |
119 | | - |
120 | | - |
121 | | - |
122 | | - |
123 | | - |
124 | | - |
125 | | - |
126 | | - |
127 | | - |
128 | | - |
129 | | - |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | + |
130 | 97 | |
131 | | - |
Collapse file
tests/unit/test_kernel_auth_bridge.py
Copy file name to clipboard+54-43Lines changed: 54 additions & 43 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | 2 | |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
7 | 10 | |
8 | 11 | |
9 | 12 | |
| ||
12 | 15 | |
13 | 16 | |
14 | 17 | |
15 | | - |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
16 | 24 | |
17 | 25 | |
18 | 26 | |
19 | 27 | |
| 28 | + |
20 | 29 | |
21 | 30 | |
22 | 31 | |
23 | | - |
24 | | - |
25 | | - |
26 | | - |
27 | | - |
28 | | - |
| 32 | + |
| 33 | + |
29 | 34 | |
30 | 35 | |
31 | | - |
32 | | - |
| 36 | + |
33 | 37 | |
34 | 38 | |
35 | 39 | |
36 | | - |
37 | | - |
38 | | - |
| 40 | + |
39 | 41 | |
40 | 42 | |
41 | 43 | |
42 | 44 | |
43 | 45 | |
44 | 46 | |
45 | | - |
46 | | - |
| 47 | + |
47 | 48 | |
48 | 49 | |
49 | 50 | |
| ||
74 | 75 | |
75 | 76 | |
76 | 77 | |
77 | | - |
78 | | - |
79 | | - |
80 | 78 | |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
81 | 84 | |
82 | 85 | |
83 | | - |
84 | | - |
85 | | - |
86 | 86 | |
87 | 87 | |
88 | 88 | |
89 | 89 | |
90 | | - |
| 90 | + |
91 | 91 | |
92 | 92 | |
93 | 93 | |
94 | 94 | |
95 | | - |
96 | 95 | |
97 | 96 | |
98 | 97 | |
99 | 98 | |
100 | | - |
101 | | - |
102 | | - |
103 | | - |
104 | | - |
105 | | - |
106 | | - |
107 | | - |
108 | | - |
109 | | - |
110 | | - |
111 | | - |
112 | | - |
113 | | - |
114 | | - |
115 | | - |
116 | | - |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | + |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | + |
| 125 | + |
| 126 | + |
| 127 | + |
0 commit comments