MCPcopy Create free account
hub / github.com/kubernetes-client/python / auth_settings

Method auth_settings

kubernetes/client/configuration.py:403–424  ·  view source on GitHub ↗

Gets Auth Settings dict for api client. :return: The Auth Settings information dict.

(self)

Source from the content-addressed store, hash-verified

401 ).get('authorization')
402
403 def auth_settings(self):
404 """Gets Auth Settings dict for api client.
405
406 :return: The Auth Settings information dict.
407 """
408 auth = {}
409 # Backward compatibility: prior to v36.0.0 the bearer token was
410 # stored under the 'authorization' api_key. Continue to honor it
411 # so user code that sets ``config.api_key['authorization']``
412 # directly keeps working with the new 'BearerToken' key the
413 # generated client now looks for.
414 # See: https://github.com/kubernetes-client/python/issues/2595
415 if 'BearerToken' in self.api_key or 'authorization' in self.api_key:
416 auth['BearerToken'] = {
417 'type': 'api_key',
418 'in': 'header',
419 'key': 'authorization',
420 'value': self.get_api_key_with_prefix(
421 'BearerToken', alias='authorization',
422 ),
423 }
424 return auth
425
426 def to_debug_report(self):
427 """Gets the essential information for debugging.

Callers 3

_bearer_valueMethod · 0.45

Calls 1

Tested by 2

_bearer_valueMethod · 0.36