mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 20:20:49 +00:00
Move npm and pip mitm interception to separate files
This commit is contained in:
parent
e251908cb3
commit
f4694ba119
8 changed files with 350 additions and 224 deletions
|
|
@ -41,6 +41,22 @@ export function getAuditStats() {
|
|||
return auditStats;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string | undefined} name
|
||||
* @param {string | undefined} version
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
export async function isMalwarePackage(name, version) {
|
||||
if (!name || !version) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const auditResult = await auditChanges([{ name, version, type: "add" }]);
|
||||
|
||||
return !auditResult.isAllowed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {PackageChange[]} changes
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue