mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 20:20:49 +00:00
Cleanup formatting changes from PR
This commit is contained in:
parent
912f62f3b9
commit
e8a4fbcd76
19 changed files with 200 additions and 407 deletions
|
|
@ -7,7 +7,7 @@ import {
|
|||
|
||||
/**
|
||||
* Sets CA bundle environment variables used by Python libraries and pipx.
|
||||
*
|
||||
*
|
||||
* @param {NodeJS.ProcessEnv} env - Env object
|
||||
* @param {string} combinedCaPath - Path to the combined CA bundle
|
||||
* @return {NodeJS.ProcessEnv} Modified environment object
|
||||
|
|
@ -16,23 +16,17 @@ function getPipXCaBundleEnvironmentVariables(env, combinedCaPath) {
|
|||
let retVal = { ...env };
|
||||
|
||||
if (env.SSL_CERT_FILE) {
|
||||
ui.writeWarning(
|
||||
"Safe-chain: User defined SSL_CERT_FILE found in environment. It will be overwritten.",
|
||||
);
|
||||
ui.writeWarning("Safe-chain: User defined SSL_CERT_FILE found in environment. It will be overwritten.");
|
||||
}
|
||||
retVal.SSL_CERT_FILE = combinedCaPath;
|
||||
|
||||
if (env.REQUESTS_CA_BUNDLE) {
|
||||
ui.writeWarning(
|
||||
"Safe-chain: User defined REQUESTS_CA_BUNDLE found in environment. It will be overwritten.",
|
||||
);
|
||||
ui.writeWarning("Safe-chain: User defined REQUESTS_CA_BUNDLE found in environment. It will be overwritten.");
|
||||
}
|
||||
retVal.REQUESTS_CA_BUNDLE = combinedCaPath;
|
||||
|
||||
if (env.PIP_CERT) {
|
||||
ui.writeWarning(
|
||||
"Safe-chain: User defined PIP_CERT found in environment. It will be overwritten.",
|
||||
);
|
||||
ui.writeWarning("Safe-chain: User defined PIP_CERT found in environment. It will be overwritten.");
|
||||
}
|
||||
retVal.PIP_CERT = combinedCaPath;
|
||||
return retVal;
|
||||
|
|
@ -40,7 +34,7 @@ function getPipXCaBundleEnvironmentVariables(env, combinedCaPath) {
|
|||
|
||||
/**
|
||||
* Runs a pipx command with safe-chain's certificate bundle and proxy configuration.
|
||||
*
|
||||
*
|
||||
* @param {string} command - The command to execute
|
||||
* @param {string[]} args - Command line arguments
|
||||
* @returns {Promise<{status: number}>} Exit status of the command
|
||||
|
|
@ -50,10 +44,7 @@ export async function runPipX(command, args) {
|
|||
const env = mergeSafeChainProxyEnvironmentVariables(process.env);
|
||||
|
||||
const combinedCaPath = getProxySettings().caCertBundlePath;
|
||||
const modifiedEnv = getPipXCaBundleEnvironmentVariables(
|
||||
env,
|
||||
combinedCaPath,
|
||||
);
|
||||
const modifiedEnv = getPipXCaBundleEnvironmentVariables(env, combinedCaPath);
|
||||
|
||||
// Note: pipx uses HTTPS_PROXY and HTTP_PROXY environment variables for proxy configuration
|
||||
// These are already set by mergeSafeChainProxyEnvironmentVariables
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue