Skip to content

Commit 6bfed83

Browse files
authored
Merge pull request #1022 from davidgamero/davidgamero/request-migration-auth
remove request usages from auth & config
2 parents d9626f9 + fa56f36 commit 6bfed83

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/auth.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import https = require('https');
2-
import request = require('request');
32

43
import { User } from './config_types';
54

65
export interface Authenticator {
76
isAuthProvider(user: User): boolean;
8-
applyAuthentication(user: User, opts: request.Options | https.RequestOptions): Promise<void>;
7+
applyAuthentication(user: User, opts: https.RequestOptions): Promise<void>;
98
}

src/config.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import yaml = require('js-yaml');
55
import net = require('net');
66
import path = require('path');
77

8-
import request = require('request');
98
import shelljs = require('shelljs');
109

1110
import * as api from './api';
@@ -459,7 +458,7 @@ export class KubeConfig implements SecurityAuthentication {
459458
return this.getContextObject(this.currentContext);
460459
}
461460

462-
private applyHTTPSOptions(opts: request.Options | https.RequestOptions): void {
461+
private applyHTTPSOptions(opts: https.RequestOptions): void {
463462
const cluster = this.getCurrentCluster();
464463
const user = this.getCurrentUser();
465464
if (!user) {
@@ -483,7 +482,7 @@ export class KubeConfig implements SecurityAuthentication {
483482
}
484483
}
485484

486-
private async applyAuthorizationHeader(opts: request.Options | https.RequestOptions): Promise<void> {
485+
private async applyAuthorizationHeader(opts: https.RequestOptions): Promise<void> {
487486
const user = this.getCurrentUser();
488487
if (!user) {
489488
return;
@@ -504,7 +503,7 @@ export class KubeConfig implements SecurityAuthentication {
504503
}
505504
}
506505

507-
private async applyOptions(opts: request.Options | https.RequestOptions): Promise<void> {
506+
private async applyOptions(opts: https.RequestOptions): Promise<void> {
508507
this.applyHTTPSOptions(opts);
509508
await this.applyAuthorizationHeader(opts);
510509
}

0 commit comments

Comments
 (0)