@@ -1468,7 +1468,7 @@ def test_user_exec_auth(self, mock):
1468
1468
"token" : token
1469
1469
}
1470
1470
expected = FakeConfig (host = TEST_HOST , api_key = {
1471
- "authorization " : BEARER_TOKEN_FORMAT % token })
1471
+ "BearerToken " : BEARER_TOKEN_FORMAT % token })
1472
1472
actual = FakeConfig ()
1473
1473
KubeConfigLoader (
1474
1474
config_dict = self .TEST_KUBE_CONFIG ,
@@ -1498,13 +1498,13 @@ def test_user_exec_auth_with_expiry(self, mock):
1498
1498
active_context = "exec_cred_user" ).load_and_set (fake_config )
1499
1499
# The kube config should use the first token returned from the
1500
1500
# exec provider.
1501
- self .assertEqual (fake_config .api_key ["authorization " ],
1501
+ self .assertEqual (fake_config .api_key ["BearerToken " ],
1502
1502
BEARER_TOKEN_FORMAT % expired_token )
1503
1503
# Should now be populated with a method to refresh expired tokens.
1504
1504
self .assertIsNotNone (fake_config .refresh_api_key_hook )
1505
1505
# Refresh the token; the kube config should be updated.
1506
1506
fake_config .refresh_api_key_hook (fake_config )
1507
- self .assertEqual (fake_config .api_key ["authorization " ],
1507
+ self .assertEqual (fake_config .api_key ["BearerToken " ],
1508
1508
BEARER_TOKEN_FORMAT % current_token )
1509
1509
1510
1510
@mock .patch ('kubernetes.config.kube_config.ExecProvider.run' )
@@ -1546,7 +1546,7 @@ def test_user_cmd_path(self):
1546
1546
return_value = A (token , parse_rfc3339 (datetime .datetime .now ()))
1547
1547
CommandTokenSource .token = mock .Mock (return_value = return_value )
1548
1548
expected = FakeConfig (api_key = {
1549
- "authorization " : BEARER_TOKEN_FORMAT % token })
1549
+ "BearerToken " : BEARER_TOKEN_FORMAT % token })
1550
1550
actual = FakeConfig ()
1551
1551
KubeConfigLoader (
1552
1552
config_dict = self .TEST_KUBE_CONFIG ,
@@ -1559,7 +1559,7 @@ def test_user_cmd_path_empty(self):
1559
1559
return_value = A (token , parse_rfc3339 (datetime .datetime .now ()))
1560
1560
CommandTokenSource .token = mock .Mock (return_value = return_value )
1561
1561
expected = FakeConfig (api_key = {
1562
- "authorization " : BEARER_TOKEN_FORMAT % token })
1562
+ "BearerToken " : BEARER_TOKEN_FORMAT % token })
1563
1563
actual = FakeConfig ()
1564
1564
self .expect_exception (lambda : KubeConfigLoader (
1565
1565
config_dict = self .TEST_KUBE_CONFIG ,
@@ -1573,7 +1573,7 @@ def test_user_cmd_path_with_scope(self):
1573
1573
return_value = A (token , parse_rfc3339 (datetime .datetime .now ()))
1574
1574
CommandTokenSource .token = mock .Mock (return_value = return_value )
1575
1575
expected = FakeConfig (api_key = {
1576
- "authorization " : BEARER_TOKEN_FORMAT % token })
1576
+ "BearerToken " : BEARER_TOKEN_FORMAT % token })
1577
1577
actual = FakeConfig ()
1578
1578
self .expect_exception (lambda : KubeConfigLoader (
1579
1579
config_dict = self .TEST_KUBE_CONFIG ,
0 commit comments