mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 20:20:49 +00:00
Adapt per latest core
This commit is contained in:
parent
07e315a382
commit
ac09534070
4 changed files with 35 additions and 26 deletions
|
|
@ -11,9 +11,9 @@ const malwareDatabaseUrls = {
|
|||
[ECOSYSTEM_PY]: "https://malware-list.aikido.dev/malware_pypi.json",
|
||||
};
|
||||
|
||||
// TODO: replace with the real CDN URL once core publishes the S3 endpoint
|
||||
const newPackagesListUrls = {
|
||||
[ECOSYSTEM_JS]: "https://new-packages.aikido.dev/js_packages.json",
|
||||
[ECOSYSTEM_JS]: "https://malware-list.aikido.dev/releases_npm.json",
|
||||
[ECOSYSTEM_PY]: "https://malware-list.aikido.dev/releases_pypi.json",
|
||||
};
|
||||
|
||||
const DEFAULT_FETCH_RETRY_ATTEMPTS = 4;
|
||||
|
|
@ -27,8 +27,8 @@ const DEFAULT_FETCH_RETRY_ATTEMPTS = 4;
|
|||
|
||||
/**
|
||||
* @typedef {Object} NewPackageEntry
|
||||
* @property {string} source
|
||||
* @property {string} name
|
||||
* @property {string} [source]
|
||||
* @property {string} package_name
|
||||
* @property {string} version
|
||||
* @property {number} released_on - Unix timestamp (seconds)
|
||||
* @property {number} scraped_on - Unix timestamp (seconds)
|
||||
|
|
|
|||
|
|
@ -141,8 +141,7 @@ describe("aikido API", async () => {
|
|||
it("should succeed immediately when fetch succeeds on first try", async () => {
|
||||
const releases = [
|
||||
{
|
||||
source: "NPM",
|
||||
name: "fresh-pkg",
|
||||
package_name: "fresh-pkg",
|
||||
version: "1.0.0",
|
||||
released_on: 123,
|
||||
scraped_on: 456,
|
||||
|
|
@ -174,7 +173,7 @@ describe("aikido API", async () => {
|
|||
});
|
||||
|
||||
it("should return an empty list without fetching for unsupported ecosystems", async () => {
|
||||
ecosystem = "py";
|
||||
ecosystem = "ruby";
|
||||
|
||||
const result = await fetchNewPackagesList();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue