8000 build(deps): bump @types/node from 22.15.11 to 22.15.14 (#2423) · schrodit/k8s-javascript@15e4ebf · GitHub
[go: up one dir, main page]

Skip to content

Commit 15e4ebf

Browse files
build(deps): bump @types/node from 22.15.11 to 22.15.14 (kubernetes-client#2423)
* build(deps): bump @types/node from 22.15.11 to 22.15.14 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.15.11 to 22.15.14. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-version: 22.15.14 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * refactor: assign authorization header correctly * test: change assignments of authorization headers --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Max Strübing <mxstrbng@gmail.com>
1 parent beca786 commit 15e4ebf

8 files changed

+23
-23
lines changed

package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/azure_auth.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class AzureAuth implements Authenticator {
2929
public async applyAuthentication(user: User, opts: https.RequestOptions): Promise<void> {
3030
const token = this.getToken(user);
3131
if (token) {
32-
opts.headers!.Authorization = `Bearer ${token}`;
32+
opts.headers!['Authorization'] = `Bearer ${token}`;
3333
}
3434
}
3535

src/config_test.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ describe('KubeConfig', () => {
962962
const opts = {} as RequestOptions;
963963

964964
await config.applyToHTTPSOptions(opts);
965-
strictEqual(opts.headers!.Authorization, `Bearer ${token}`);
965+
strictEqual(opts.headers!['Authorization'], `Bearer ${token}`);
966966
});
967967
it('should populate from auth provider', async () => {
968968
const config = new KubeConfig();
@@ -982,11 +982,11 @@ describe('KubeConfig', () => {
982982
const opts = {} as RequestOptions;
983983

984984
await config.applyToHTTPSOptions(opts);
985-
strictEqual(opts.headers!.Authorization, `Bearer ${token}`);
985+
strictEqual(opts.headers!['Authorization'], `Bearer ${token}`);
986986
opts.headers = {};
987987
opts.headers.Host = 'foo.com';
988988
await config.applyToHTTPSOptions(opts);
989-
strictEqual(opts.headers.Authorization, `Bearer ${token}`);
989+
strictEqual(opts.headers!['Authorization'], `Bearer ${token}`);
990990
});
991991

992992
it('should populate from auth provider without expirty', async () => {
@@ -1006,7 +1006,7 @@ describe('KubeConfig', () => {
10061006
const opts = {} as RequestOptions;
10071007

10081008
await config.applyToHTTPSOptions(opts);
1009-
strictEqual(opts.headers!.Authorization, `Bearer ${token}`);
1009+
strictEqual(opts.headers!['Authorization'], `Bearer ${token}`);
10101010
});
10111011

10121012
it('should populate rejectUnauthorized=false when skipTLSVerify is set', async () => {
@@ -1115,7 +1115,7 @@ describe('KubeConfig', () => {
11151115
);
11161116
const opts = {} as RequestOptions;
11171117
await config.applyToHTTPSOptions(opts);
1118-
strictEqual(opts.headers!.Authorization, `Bearer ${token}`);
1118+
strictEqual(opts.headers!['Authorization'], `Bearer ${token}`);
11191119
});
11201120

11211121
it('should exec with expired token', async () => {
@@ -1143,7 +1143,7 @@ describe('KubeConfig', () => {
11431143
);
11441144
const opts = {} as RequestOptions;
11451145
await 9E81 config.applyToHTTPSOptions(opts);
1146-
strictEqual(opts.headers!.Authorization, `Bearer ${token}`);
1146+
strictEqual(opts.headers!['Authorization'], `Bearer ${token}`);
11471147
});
11481148

11491149
it('should exec without access-token', async () => {
@@ -1170,7 +1170,7 @@ describe('KubeConfig', () => {
11701170
);
11711171
const opts = {} as RequestOptions;
11721172
await config.applyToHTTPSOptions(opts);
1173-
strictEqual(opts.headers!.Authorization, `Bearer ${token}`);
1173+
strictEqual(opts.headers!['Authorization'], `Bearer ${token}`);
11741174
});
11751175
it('should exec without access-token', async () => {
11761176
// TODO: fix this test for Windows
@@ -1196,7 +1196,7 @@ describe('KubeConfig', () => {
11961196
);
11971197
const opts = {} as RequestOptions;
11981198
await config.applyToHTTPSOptions(opts);
1199-
strictEqual(opts.headers!.Authorization, `Bearer ${token}`);
1199+
strictEqual(opts.headers!['Authorization'], `Bearer ${token}`);
12001200
});
12011201
it('should exec succesfully with spaces in cmd', async () => {
12021202
// TODO: fix this test for Windows
@@ -1222,7 +1222,7 @@ describe('KubeConfig', () => {
12221222
);
12231223
const opts = {} as RequestOptions;
12241224
await config.applyToHTTPSOptions(opts);
1225-
strictEqual(opts.headers!.Authorization, `Bearer ${token}`);
1225+
strictEqual(opts.headers!['Authorization'], `Bearer ${token}`);
12261226
});
12271227
it('should exec with exec auth and env vars', async () => {
12281228
// TODO: fix this test for Windows
@@ -1255,7 +1255,7 @@ describe('KubeConfig', () => {
12551255
// TODO: inject the exec command here and validate env vars?
12561256
const opts = {} as RequestOptions;
12571257
await config.applyToHTTPSOptions(opts);
1258-
strictEqual(opts.headers!.Authorization, `Bearer ${token}`);
1258+
strictEqual(opts.headers!['Authorization'], `Bearer ${token}`);
12591259
});
12601260
it('should exec with exec auth', async () => {
12611261
// TODO: fix this test for Windows
@@ -1288,7 +1288,7 @@ describe('KubeConfig', () => {
12881288
// TODO: inject the exec command here?
12891289
const opts = {} as RequestOptions;
12901290
await config.applyToHTTPSOptions(opts);
1291-
strictEqual(opts.headers!.Authorization, `Bearer ${token}`);
1291+
strictEqual(opts.headers!['Authorization'], `Bearer ${token}`);
12921292
});
12931293
it('should exec with exec auth (other location)', async () => {
12941294
// TODO: fix this test for Windows
@@ -1316,7 +1316,7 @@ describe('KubeConfig', () => {
13161316
// TODO: inject the exec command here?
13171317
const opts = {} as RequestOptions;
13181318
await config.applyToHTTPSOptions(opts);
1319-
strictEqual(opts.headers!.Authorization, `Bearer ${token}`);
1319+
strictEqual(opts.headers!['Authorization'], `Bearer ${token}`);
13201320
});
13211321
it('should cache exec with name', async () => {
13221322
// TODO: fix this test for Windows
@@ -1776,7 +1776,7 @@ describe('KubeConfig', () => {
17761776
// Simulate token retrieval
17771777
const token = 'test-token';
17781778
opts.headers = opts.headers || {};
1779-
opts.headers.Authorization = `Bearer ${token}`;
1779+
opts.headers['Authorization'] = `Bearer ${token}`;
17801780
} else {
17811781
throw new Error('No custom configuration found');
17821782
}
@@ -1802,7 +1802,7 @@ describe('KubeConfig', () => {
18021802
const opts: RequestOptions = {};
18031803
await kc.applyToHTTPSOptions(opts);
18041804

1805-
strictEqual(opts.headers!.Authorization, 'Bearer test-token');
1805+
strictEqual(opts.headers!['Authorization'], 'Bearer test-token');
18061806
});
18071807
});
18081808

src/exec_auth.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class ExecAuth implements Authenticator {
5656
if (!opts.headers) {
5757
opts.headers = {} as OutgoingHttpHeaders;
5858
}
59-
opts.headers!.Authorization = `Bearer ${token}`;
59+
opts.headers!['Authorization'] = `Bearer ${token}`;
6060
}
6161
}
6262

src/exec_auth_test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ describe('ExecAuth', () => {
486486
},
487487
opts,
488488
);
489-
strictEqual(opts.headers?.Authorization, 'Bearer foo');
489+
strictEqual(opts.headers!['Authorization'], 'Bearer foo');
490490
});
491491
it('should handle null credentials correctly', async () => {
492492
const auth = new ExecAuth();

src/file_auth.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export class FileAuth implements Authenticator {
2020
this.refreshToken(user.authProvider.config.tokenFile);
2121
}
2222
if (this.token) {
23-
opts.headers!.Authorization = `Bearer ${this.token}`;
23+
opts.headers!['Authorization'] = `Bearer ${this.token}`;
2424
}
2525
}
2626

src/gcp_auth.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class GoogleCloudPlatformAuth implements Authenticator {
2828
public async applyAuthentication(user: User, opts: https.RequestOptions): Promise<void> {
2929
const token = this.getToken(user);
3030
if (token) {
31-
opts.headers!.Authorization = `Bearer ${token}`;
31+
opts.headers!['Authorization'] = `Bearer ${token}`;
3232
}
3333
}
3434

src/oidc_auth.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export class OpenIDConnectAuth implements Authenticator {
8585
): Promise<void> {
8686
const token = await this.getToken(user, overrideClient);
8787
if (token) {
88-
opts.headers!.Authorization = `Bearer ${token}`;
88+
opts.headers!['Authorization'] = `Bearer ${token}`;
8989
}
9090
}
9191

0 commit comments

Comments
 (0)
0