Commit 6da9c9a
authored
config: also extract ?w= from Host URL (#1704)
## Changes
Follow-up to #1699, which started promoting `?o=`/`?workspace_id=` and
`?a=`/`?account_id=` from `Config.Host` into
`Config.WorkspaceID`/`Config.AccountID` during `fixHostIfNeeded`.
`?w=` is the unified workspace addressing query parameter that
supersedes `?o=`/`?workspace_id=`. It accepts a broader range of
workspace identifier formats — both classic numeric workspace IDs and
other identifier formats the server understands — so the numeric-only
validation applied to `?o=`/`?workspace_id=` is intentionally not
applied to `?w=`.
Priority order in `workspaceIDFromQuery` becomes:
1. `?w=` — any non-empty value
2. `?o=` — numeric only
3. `?workspace_id=` — numeric only
Existing `Config.WorkspaceID` is still never overwritten.
## Tests
Four cases added to the existing
`TestConfig_fixHostIfNeeded_extractsWorkspaceIDFromQuery` table-driven
test:
- `?w=12345` is promoted to `Config.WorkspaceID`.
- `?w=7a99b43c-b46c-432b-b0a7-814217701909` (UUID-shaped) is promoted
as-is.
- `?w=` takes precedence over `?o=` when both appear.
- An existing `Config.WorkspaceID` is preserved when `?w=` is present.
`make fmt test lint` clean.
NO_CHANGELOG=true
Signed-off-by: Divyansh Vijayvergia <divyansh.vijayvergia@databricks.com>1 parent 59ad59e commit 6da9c9a
2 files changed
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
653 | 653 | | |
654 | 654 | | |
655 | 655 | | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
656 | 664 | | |
657 | 665 | | |
658 | 666 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1362 | 1362 | | |
1363 | 1363 | | |
1364 | 1364 | | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
1365 | 1390 | | |
1366 | 1391 | | |
1367 | 1392 | | |
| |||
0 commit comments