@@ -962,7 +962,7 @@ describe('KubeConfig', () => {
962
962
const opts = { } as RequestOptions ;
963
963
964
964
await config . applyToHTTPSOptions ( opts ) ;
965
- strictEqual ( opts . headers ! . Authorization , `Bearer ${ token } ` ) ;
965
+ strictEqual ( opts . headers ! [ ' Authorization' ] , `Bearer ${ token } ` ) ;
966
966
} ) ;
967
967
it ( 'should populate from auth provider' , async ( ) => {
968
968
const config = new KubeConfig ( ) ;
@@ -982,11 +982,11 @@ describe('KubeConfig', () => {
982
982
const opts = { } as RequestOptions ;
983
983
984
984
await config . applyToHTTPSOptions ( opts ) ;
985
- strictEqual ( opts . headers ! . Authorization , `Bearer ${ token } ` ) ;
985
+ strictEqual ( opts . headers ! [ ' Authorization' ] , `Bearer ${ token } ` ) ;
986
986
opts . headers = { } ;
987
987
opts . headers . Host = 'foo.com' ;
988
988
await config . applyToHTTPSOptions ( opts ) ;
989
- strictEqual ( opts . headers . Authorization , `Bearer ${ token } ` ) ;
989
+ strictEqual ( opts . headers ! [ ' Authorization' ] , `Bearer ${ token } ` ) ;
990
990
} ) ;
991
991
992
992
it ( 'should populate from auth provider without expirty' , async ( ) => {
@@ -1006,7 +1006,7 @@ describe('KubeConfig', () => {
1006
1006
const opts = { } as RequestOptions ;
1007
1007
1008
1008
await config . applyToHTTPSOptions ( opts ) ;
1009
- strictEqual ( opts . headers ! . Authorization , `Bearer ${ token } ` ) ;
1009
+ strictEqual ( opts . headers ! [ ' Authorization' ] , `Bearer ${ token } ` ) ;
1010
1010
} ) ;
1011
1011
1012
1012
it ( 'should populate rejectUnauthorized=false when skipTLSVerify is set' , async ( ) => {
@@ -1115,7 +1115,7 @@ describe('KubeConfig', () => {
1115
1115
) ;
1116
1116
const opts = { } as RequestOptions ;
1117
1117
await config . applyToHTTPSOptions ( opts ) ;
1118
- strictEqual ( opts . headers ! . Authorization , `Bearer ${ token } ` ) ;
1118
+ strictEqual ( opts . headers ! [ ' Authorization' ] , `Bearer ${ token } ` ) ;
1119
1119
} ) ;
1120
1120
1121
1121
it ( 'should exec with expired token' , async ( ) => {
@@ -1143,7 +1143,7 @@ describe('KubeConfig', () => {
1143
1143
) ;
1144
1144
const opts = { } as RequestOptions ;
1145
1145
await config . applyToHTTPSOptions ( opts ) ;
1146
- strictEqual ( opts . headers ! . Authorization , `Bearer ${ token } ` ) ;
1146
+ strictEqual ( opts . headers ! [ ' Authorization' ] , `Bearer ${ token } ` ) ;
1147
1147
} ) ;
1148
1148
1149
1149
it ( 'should exec without access-token' , async ( ) => {
@@ -1170,7 +1170,7 @@ describe('KubeConfig', () => {
1170
1170
) ;
1171
1171
const opts = { } as RequestOptions ;
1172
1172
await config . applyToHTTPSOptions ( opts ) ;
1173
- strictEqual ( opts . headers ! . Authorization , `Bearer ${ token } ` ) ;
1173
+ strictEqual ( opts . headers ! [ ' Authorization' ] , `Bearer ${ token } ` ) ;
1174
1174
} ) ;
1175
1175
it ( 'should exec without access-token' , async ( ) => {
1176
1176
// TODO: fix this test for Windows
@@ -1196,7 +1196,7 @@ describe('KubeConfig', () => {
1196
1196
) ;
1197
1197
const opts = { } as RequestOptions ;
1198
1198
await config . applyToHTTPSOptions ( opts ) ;
1199
- strictEqual ( opts . headers ! . Authorization , `Bearer ${ token } ` ) ;
1199
+ strictEqual ( opts . headers ! [ ' Authorization' ] , `Bearer ${ token } ` ) ;
1200
1200
} ) ;
1201
1201
it ( 'should exec succesfully with spaces in cmd' , async ( ) => {
1202
1202
// TODO: fix this test for Windows
@@ -1222,7 +1222,7 @@ describe('KubeConfig', () => {
1222
1222
) ;
1223
1223
const opts = { } as RequestOptions ;
1224
1224
await config . applyToHTTPSOptions ( opts ) ;
1225
- strictEqual ( opts . headers ! . Authorization , `Bearer ${ token } ` ) ;
1225
+ strictEqual ( opts . headers ! [ ' Authorization' ] , `Bearer ${ token } ` ) ;
1226
1226
} ) ;
1227
1227
it ( 'should exec with exec auth and env vars' , async ( ) => {
1228
1228
// TODO: fix this test for Windows
@@ -1255,7 +1255,7 @@ describe('KubeConfig', () => {
1255
1255
// TODO: inject the exec command here and validate env vars?
1256
1256
const opts = { } as RequestOptions ;
1257
1257
await config . applyToHTTPSOptions ( opts ) ;
1258
- strictEqual ( opts . headers ! . Authorization , `Bearer ${ token } ` ) ;
1258
+ strictEqual ( opts . headers ! [ ' Authorization' ] , `Bearer ${ token } ` ) ;
1259
1259
} ) ;
1260
1260
it ( 'should exec with exec auth' , async ( ) => {
1261
1261
// TODO: fix this test for Windows
@@ -1288,7 +1288,7 @@ describe('KubeConfig', () => {
1288
1288
// TODO: inject the exec command here?
1289
1289
const opts = { } as RequestOptions ;
1290
1290
await config . applyToHTTPSOptions ( opts ) ;
1291
- strictEqual ( opts . headers ! . Authorization , `Bearer ${ token } ` ) ;
1291
+ strictEqual ( opts . headers ! [ ' Authorization' ] , `Bearer ${ token } ` ) ;
1292
1292
} ) ;
1293
1293
it ( 'should exec with exec auth (other location)' , async ( ) => {
1294
1294
// TODO: fix this test for Windows
@@ -1316,7 +1316,7 @@ describe('KubeConfig', () => {
1316
1316
// TODO: inject the exec command here?
1317
1317
EF5E
const opts = { } as RequestOptions ;
1318
1318
await config . applyToHTTPSOptions ( opts ) ;
1319
- strictEqual ( opts . headers ! . Authorization , `Bearer ${ token } ` ) ;
1319
+ strictEqual ( opts . headers ! [ ' Authorization' ] , `Bearer ${ token } ` ) ;
1320
1320
} ) ;
1321
1321
it ( 'should cache exec with name' , async ( ) => {
1322
1322
// TODO: fix this test for Windows
@@ -1776,7 +1776,7 @@ describe('KubeConfig', () => {
1776
1776
// Simulate token retrieval
1777
1777
const token = 'test-token' ;
1778
1778
opts . headers = opts . headers || { } ;
1779
- opts . headers . Authorization = `Bearer ${ token } ` ;
1779
+ opts . headers [ ' Authorization' ] = `Bearer ${ token } ` ;
1780
1780
} else {
1781
1781
throw new Error ( 'No custom configuration found' ) ;
1782
1782
}
@@ -1802,7 +1802,7 @@ describe('KubeConfig', () => {
1802
1802
const opts : RequestOptions = { } ;
1803
1803
await kc . applyToHTTPSOptions ( opts ) ;
1804
1804
1805
- strictEqual ( opts . headers ! . Authorization , 'Bearer test-token' ) ;
1805
+ strictEqual ( opts . headers ! [ ' Authorization' ] , 'Bearer test-token' ) ;
1806
1806
} ) ;
1807
1807
} ) ;
1808
1808
0 commit comments