Commit 2fa3228
authored
Add DATABRICKS_OIDC_TOKEN_FILEPATH env var support (#1334)
## Summary
The Go SDK, CLI, and Terraform all use `DATABRICKS_OIDC_TOKEN_FILEPATH`,
while the Python SDK used `DATABRICKS_OIDC_TOKEN_FILE`. This mismatch
caused silent failures for users coming from Go/CLI/Terraform.
This PR:
- Adds an `env_aliases` mechanism to `ConfigAttribute` so a config field
can be loaded from multiple env vars with clear precedence (primary >
alias)
- Makes `DATABRICKS_OIDC_TOKEN_FILEPATH` the primary env var, keeping
`DATABRICKS_OIDC_TOKEN_FILE` as a backward-compatible alias
- Reports alias usage in `debug_string` output
## Test plan
- [x] Alias loads when primary is not set
- [x] Primary takes precedence over alias when both are set
- [x] Constructor arg takes precedence over both env vars1 parent 388f703 commit 2fa3228
3 files changed
Lines changed: 43 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
| 44 | + | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
| |||
109 | 112 | | |
110 | 113 | | |
111 | 114 | | |
112 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
113 | 119 | | |
114 | 120 | | |
115 | 121 | | |
| |||
557 | 563 | | |
558 | 564 | | |
559 | 565 | | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
560 | 571 | | |
561 | 572 | | |
562 | 573 | | |
| |||
709 | 720 | | |
710 | 721 | | |
711 | 722 | | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
712 | 728 | | |
713 | 729 | | |
714 | 730 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
50 | 74 | | |
51 | 75 | | |
52 | 76 | | |
| |||
0 commit comments