Commit 10add44
committed
Restore bearer-token fallback in Configuration.auth_settings()
Prior to v36.0.0 the generated client stored the bearer token under
api_key['authorization']. v36.0.0 switched the lookup to
api_key['BearerToken'] without a fallback, which silently dropped the
Authorization header from every outgoing request when callers (or the
load_kube_config path in v36.0.0) still wrote the token under
'authorization'. The result was 401 Unauthorized against every cluster
that relied on bearer-token auth, observable on both REST calls and
WebSocket exec.
Restore the legacy lookup as a fallback in auth_settings(): if
'BearerToken' is absent but 'authorization' is set, route the lookup
through get_api_key_with_prefix(..., alias='authorization') so the
existing 'authorization' key is honored. 'BearerToken' continues to
take precedence when both are set, so the new behavior is unchanged
for new code.
Applies symmetrically to kubernetes.client.configuration and
kubernetes.aio.client.configuration.
Fixes #2595
Signed-off-by: Gaurav Galiyawala <galiyawalagaurav@gmail.com>1 parent 95bc5f3 commit 10add44
3 files changed
Lines changed: 58 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
418 | | - | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
419 | 425 | | |
420 | 426 | | |
421 | 427 | | |
422 | 428 | | |
423 | 429 | | |
424 | | - | |
| 430 | + | |
425 | 431 | | |
426 | 432 | | |
427 | 433 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
409 | | - | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
410 | 416 | | |
411 | 417 | | |
412 | 418 | | |
413 | 419 | | |
414 | 420 | | |
415 | | - | |
| 421 | + | |
416 | 422 | | |
417 | 423 | | |
418 | 424 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
0 commit comments