mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 20:20:49 +00:00
feat: allow python custom registries configuration
This commit is contained in:
parent
9444c7b4f6
commit
833fa285aa
5 changed files with 259 additions and 3 deletions
|
|
@ -98,3 +98,30 @@ export function skipMinimumPackageAge() {
|
|||
|
||||
return defaultSkipMinimumPackageAge;
|
||||
}
|
||||
|
||||
/** @type {string[]} */
|
||||
const defaultPipCustomRegistries = [];
|
||||
/** @returns {string[]} */
|
||||
export function getPipCustomRegistries() {
|
||||
// Priority 1: Environment variable
|
||||
const envValue = validatePipCustomRegistries(
|
||||
environmentVariables.getPipCustomRegistries()
|
||||
);
|
||||
if (envValue !== undefined) {
|
||||
return envValue;
|
||||
}
|
||||
|
||||
return defaultPipCustomRegistries;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string | undefined} value
|
||||
* @returns {string[] | undefined}
|
||||
*/
|
||||
function validatePipCustomRegistries(value) {
|
||||
if (!value) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return value.split(",");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue