SIGN IN SIGN UP

config: write api_key['BearerToken'] so v36+ SDK auth works

v36 rewrote Configuration.auth_settings() to look up the bearer-token
credential under api_key['BearerToken'], matching the OpenAPI security
scheme name. The in-cluster and kubeconfig loaders were not updated -
they still write api_key['authorization'], the v35 lookup key. The
same gap exists in kubernetes_asyncio/config/incluster_config.py.

As a result, on v36 every call to load_incluster_config() (and
load_kube_config() with a static token, including the async equivalents)
produces a Configuration whose auth_settings() yields no bearer
credential, so outgoing API requests are sent without an Authorization
header and the apiserver treats them as system:anonymous.

Write the token under both 'authorization' (v35) and 'BearerToken'
(v36+) in all three affected loaders so requests carry the expected
header. The old key is preserved as a backward-compatibility hedge for
any third-party code introspecting api_key['authorization'] directly.

Add a regression test in incluster_config_test that drives a real
ApiClient.update_params_for_auth() against a freshly-loaded
Configuration and asserts the resulting headers contain an Authorization
entry - the end-to-end invariant that v36 quietly broke.
J
Jmacek committed
c3608a4c2b1f046f6ffd8effeca4cafeead70d5b
Parent: 26761f3