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
|
|
@ -21,42 +21,36 @@ export function createPoetryPackageManager() {
|
|||
/**
|
||||
* Sets CA bundle environment variables used by Poetry and Python libraries.
|
||||
* Poetry uses the Python requests library which respects these environment variables.
|
||||
*
|
||||
*
|
||||
* @param {NodeJS.ProcessEnv} env - Environment object to modify
|
||||
* @param {string} combinedCaPath - Path to the combined CA bundle
|
||||
*/
|
||||
function setPoetryCaBundleEnvironmentVariables(env, combinedCaPath) {
|
||||
// SSL_CERT_FILE: Used by Python SSL libraries and requests
|
||||
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.");
|
||||
}
|
||||
env.SSL_CERT_FILE = combinedCaPath;
|
||||
|
||||
// REQUESTS_CA_BUNDLE: Used by the requests library (which Poetry uses)
|
||||
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.");
|
||||
}
|
||||
env.REQUESTS_CA_BUNDLE = combinedCaPath;
|
||||
|
||||
// PIP_CERT: Poetry may use pip internally
|
||||
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.");
|
||||
}
|
||||
env.PIP_CERT = combinedCaPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs a poetry command with safe-chain's certificate bundle and proxy configuration.
|
||||
*
|
||||
*
|
||||
* Poetry respects standard HTTP_PROXY/HTTPS_PROXY environment variables through
|
||||
* the Python requests library.
|
||||
*
|
||||
*
|
||||
* @param {string[]} args - Command line arguments to pass to poetry
|
||||
* @returns {Promise<{status: number}>} Exit status of the poetry command
|
||||
*/
|
||||
|
|
@ -71,7 +65,7 @@ async function runPoetryCommand(args) {
|
|||
stdio: "inherit",
|
||||
env,
|
||||
});
|
||||
|
||||
|
||||
return { status: result.status };
|
||||
} catch (/** @type any */ error) {
|
||||
if (error.status) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue