chore: small fix

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2024-04-05 15:41:10 +02:00
parent 6c19c14799
commit 96eeea82e4
2 changed files with 21 additions and 3 deletions
@@ -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() {
@@ -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(