SIGN IN SIGN UP

Apply alias fallback to prefix lookup in get_api_key_with_prefix

PR 2604 restored the api_key['authorization'] fallback in auth_settings()
by calling get_api_key_with_prefix('BearerToken', alias='authorization'),
but get_api_key_with_prefix only applied `alias` to the api_key lookup, not
the api_key_prefix lookup. Callers that set the prefix under the legacy
'authorization' key (rather than embedding "Bearer " directly in the token)
get a bearer token with no "Bearer " prefix, which most API servers (and
GKE's anonymous-auth fallback) don't recognize as a valid Authorization
header -> system:anonymous.

Apply the same alias fallback to the prefix lookup, symmetrically in the
sync (kubernetes/client/configuration.py) and async
(kubernetes/aio/client/configuration.py) variants, matching the pattern
PR 2604 already established for the key lookup.

See https://github.com/kubernetes-client/python/issues/2592

Signed-off-by: HaimLC <110099998+HaimLC@users.noreply.github.com>
H
HaimLC committed
5a8b6a592c0e5f1c49a47e60255d1a87b3ab28b6
Parent: 1bbc0bc