Commit 97235e2
fix(kernel): forward full OAuth U2M app bundle into kernel (PECOBLR-4040) (#914)
* fix(kernel): forward full OAuth U2M app bundle into kernel (PECOBLR-4040)
On the use_kernel path, OAuth U2M forwarded only whatever the caller
explicitly set, sending a bare oauth-u2m otherwise. Since PECOBLR-4039
changed the kernel core default U2M app to databricks-sql-connector /
sql offline_access / port 8030, a bare U2M connection authenticated as
the wrong identity.
The connector is an OVERRIDE of the kernel default, so it now forwards
its full coupled bundle (client_id + oauth_scopes + redirect_port). Each
field falls back to the connector's registered databricks-sql-python
(or azure) default from the existing PYSQL_OAUTH_* constants, giving
parity with the Thrift path. Explicit caller overrides and
identity_federation_client_id forwarding are preserved.
Co-authored-by: Isaac
Signed-off-by: eric-wang-1990 <e.wang@databricks.com>
* ai: apply changes for #914 (1 review thread)
Addresses:
- #3799256419 at src/databricks/sql/backend/kernel/auth_bridge.py:266
Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>
* ai: apply changes for #914 (1 review thread)
Addresses:
- #3799336213 at src/databricks/sql/backend/kernel/auth_bridge.py:275
Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>
* ai: apply changes for #914 (1 review thread)
Addresses:
- #3799379619 at src/databricks/sql/backend/kernel/auth_bridge.py:283
Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>
* fix(kernel): don't handle azure-oauth U2M yet; reject it (PECOBLR-4120)
Azure AD U2M can't work through the kernel today: the kernel resolves
OAuth endpoints only from the workspace-native OIDC config and has no
Azure AD path, so the Thrift azure-oauth flow (AAD token endpoint +
/user_impersonation scope) cannot be reproduced. Rather than forward an
azure bundle that authenticates against the wrong endpoints, reject
auth_type='azure-oauth' up front with a clear NotSupportedError pointing
at the Thrift backend. The kernel U2M path now handles databricks-oauth
only. Azure support is tracked by PECOBLR-4120.
Also fixes the stale scope tests the prior review left red: scopes are
hardcoded to PYSQL_OAUTH_SCOPES for Thrift parity (not caller-
overridable), and the tests now assert that.
Co-authored-by: Isaac
Signed-off-by: eric-wang-1990 <e.wang@databricks.com>
* ai: apply changes for #914 (2 review threads)
Addresses:
- #3799622645 at src/databricks/sql/backend/kernel/auth_bridge.py:254
- #3799650240 at src/databricks/sql/backend/kernel/auth_bridge.py:300
Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>
* ai: apply changes for #914 (1 review thread)
Addresses:
- #3799717722 at src/databricks/sql/backend/kernel/auth_bridge.py:275
Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>
* ai: apply changes for #914 (1 review thread)
Addresses:
- #3799762589 at src/databricks/sql/backend/kernel/auth_bridge.py:261
Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>
* ai: apply changes for #914 (1 review thread)
Addresses:
- #3799812091 at src/databricks/sql/backend/kernel/auth_bridge.py:258
Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>
* fix(kernel): forward redirect_ports list to kernel U2M (PECOBLR-4144)
databricks-sql-kernel #257 landed: the pyo3 Session now takes
redirect_ports (a list) and no longer accepts the single redirect_port
kwarg. Update the kernel auth bridge to emit redirect_ports for
databricks-oauth U2M, forwarding the databricks-sql-python app's FULL
registered port list (PYSQL_OAUTH_REDIRECT_PORT_RANGE, 8020-8024) so the
kernel binds the first free port — busy-port fallback, matching the
Thrift DatabricksOAuthProvider. A custom client_id + explicit port pins
that single port ([port]).
Bump KERNEL_REV to the merged #257 commit (45a0d6a) so kernel-e2e builds
against the kernel that exposes redirect_ports. Tests updated.
Co-authored-by: Isaac
Signed-off-by: eric-wang-1990 <e.wang@databricks.com>
---------
Signed-off-by: eric-wang-1990 <e.wang@databricks.com>
Signed-off-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>
Co-authored-by: peco-engineer-bot[bot] <peco-engineer-bot[bot]@users.noreply.github.com>1 parent 45bfee8 commit 97235e2
4 files changed
Lines changed: 243 additions & 37 deletions
File tree
- src/databricks/sql/backend/kernel
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
3 | 6 | | |
4 | 7 | | |
5 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
| |||
48 | 53 | | |
49 | 54 | | |
50 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
51 | 61 | | |
52 | 62 | | |
53 | 63 | | |
| |||
141 | 151 | | |
142 | 152 | | |
143 | 153 | | |
144 | | - | |
145 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
146 | 159 | | |
147 | 160 | | |
148 | 161 | | |
149 | 162 | | |
150 | | - | |
151 | | - | |
152 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
153 | 172 | | |
154 | 173 | | |
155 | 174 | | |
| |||
169 | 188 | | |
170 | 189 | | |
171 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
172 | 210 | | |
173 | 211 | | |
174 | 212 | | |
| |||
178 | 216 | | |
179 | 217 | | |
180 | 218 | | |
181 | | - | |
| 219 | + | |
182 | 220 | | |
183 | 221 | | |
184 | 222 | | |
| |||
214 | 252 | | |
215 | 253 | | |
216 | 254 | | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
221 | 268 | | |
222 | | - | |
223 | | - | |
| 269 | + | |
| 270 | + | |
224 | 271 | | |
225 | | - | |
226 | | - | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
227 | 282 | | |
228 | 283 | | |
229 | 284 | | |
| |||
251 | 306 | | |
252 | 307 | | |
253 | 308 | | |
254 | | - | |
| 309 | + | |
255 | 310 | | |
256 | 311 | | |
257 | 312 | | |
258 | 313 | | |
259 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
260 | 332 | | |
261 | 333 | | |
262 | 334 | | |
| |||
0 commit comments