mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 20:27:12 +00:00
Merge pull request #3717 from akhilmhdh/feat/sort-access-control
feat: resolved cert issue with localhost
This commit is contained in:
@@ -139,6 +139,11 @@ export const identityKubernetesAuthServiceFactory = ({
|
|||||||
tokenReviewerJwt = serviceAccountJwt;
|
tokenReviewerJwt = serviceAccountJwt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let { kubernetesHost } = identityKubernetesAuth;
|
||||||
|
if (kubernetesHost.startsWith("https://") || kubernetesHost.startsWith("http://")) {
|
||||||
|
kubernetesHost = new RE2("^https?:\\/\\/").replace(kubernetesHost, "");
|
||||||
|
}
|
||||||
|
|
||||||
const tokenReviewCallback = async (host: string = identityKubernetesAuth.kubernetesHost, port?: number) => {
|
const tokenReviewCallback = async (host: string = identityKubernetesAuth.kubernetesHost, port?: number) => {
|
||||||
const baseUrl = port ? `${host}:${port}` : host;
|
const baseUrl = port ? `${host}:${port}` : host;
|
||||||
|
|
||||||
@@ -163,7 +168,8 @@ export const identityKubernetesAuthServiceFactory = ({
|
|||||||
// if ca cert, rejectUnauthorized: true
|
// if ca cert, rejectUnauthorized: true
|
||||||
httpsAgent: new https.Agent({
|
httpsAgent: new https.Agent({
|
||||||
ca: caCert,
|
ca: caCert,
|
||||||
rejectUnauthorized: !!caCert
|
rejectUnauthorized: Boolean(caCert),
|
||||||
|
servername: kubernetesHost
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -186,12 +192,6 @@ export const identityKubernetesAuthServiceFactory = ({
|
|||||||
return res.data;
|
return res.data;
|
||||||
};
|
};
|
||||||
|
|
||||||
let { kubernetesHost } = identityKubernetesAuth;
|
|
||||||
|
|
||||||
if (kubernetesHost.startsWith("https://") || kubernetesHost.startsWith("http://")) {
|
|
||||||
kubernetesHost = new RE2("^https?:\\/\\/").replace(kubernetesHost, "");
|
|
||||||
}
|
|
||||||
|
|
||||||
const [k8sHost, k8sPort] = kubernetesHost.split(":");
|
const [k8sHost, k8sPort] = kubernetesHost.split(":");
|
||||||
|
|
||||||
const data = identityKubernetesAuth.gatewayId
|
const data = identityKubernetesAuth.gatewayId
|
||||||
|
|||||||
Reference in New Issue
Block a user