diff --git a/plugins/kubernetes-backend/src/service/KubernetesBuilder.ts b/plugins/kubernetes-backend/src/service/KubernetesBuilder.ts index 3237b50417..c065b0124f 100644 --- a/plugins/kubernetes-backend/src/service/KubernetesBuilder.ts +++ b/plugins/kubernetes-backend/src/service/KubernetesBuilder.ts @@ -157,7 +157,12 @@ export class KubernetesBuilder { const authStrategyMap = this.getAuthStrategyMap(); - const proxy = this.getProxy(logger, clusterSupplier, this.env.discovery); + const proxy = this.getProxy( + logger, + clusterSupplier, + this.env.discovery, + httpAuth, + ); const serviceLocator = this.getServiceLocator(); @@ -351,6 +356,7 @@ export class KubernetesBuilder { logger: Logger, clusterSupplier: KubernetesClustersSupplier, discovery: DiscoveryService, + httpAuth: HttpAuthService, ): KubernetesProxy { const authStrategyMap = this.getAuthStrategyMap(); const authStrategy = new DispatchStrategy({ @@ -361,6 +367,7 @@ export class KubernetesBuilder { clusterSupplier, authStrategy, discovery, + httpAuth, }); return this.proxy; } @@ -536,8 +543,12 @@ export class KubernetesBuilder { logger: Logger, clusterSupplier: KubernetesClustersSupplier, discovery: DiscoveryService, + httpAuth: HttpAuthService, ) { - return this.proxy ?? this.buildProxy(logger, clusterSupplier, discovery); + return ( + this.proxy ?? + this.buildProxy(logger, clusterSupplier, discovery, httpAuth) + ); } protected getAuthStrategyMap() { diff --git a/plugins/kubernetes-backend/src/service/KubernetesProxy.ts b/plugins/kubernetes-backend/src/service/KubernetesProxy.ts index 7c5df280e9..8cd5f0159a 100644 --- a/plugins/kubernetes-backend/src/service/KubernetesProxy.ts +++ b/plugins/kubernetes-backend/src/service/KubernetesProxy.ts @@ -84,6 +84,7 @@ export type KubernetesProxyOptions = { clusterSupplier: KubernetesClustersSupplier; authStrategy: AuthenticationStrategy; discovery: DiscoveryService; + httpAuth?: HttpAuthService; }; /** @@ -102,7 +103,13 @@ export class KubernetesProxy { this.logger = options.logger; this.clusterSupplier = options.clusterSupplier; this.authStrategy = options.authStrategy; - this.httpAuth = createLegacyAuthAdapters({ discovery: options.discovery }); + + const legacy = createLegacyAuthAdapters({ + discovery: options.discovery, + httpAuth: options.httpAuth, + }); + + this.httpAuth = legacy.httpAuth; } public createRequestHandler(