fad-checker 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +65 -0
- package/README.md +147 -25
- package/completions/fad-checker.bash +1 -1
- package/completions/fad-checker.zsh +14 -1
- package/data/eol-mapping.json +5 -5
- package/data/license-policy.json +97 -0
- package/fad-checker-report/cve-report.doc +630 -0
- package/fad-checker-report/cve-report.html +748 -0
- package/fad-checker.js +556 -245
- package/lib/cache-archive.js +3 -0
- package/lib/codecs/codec.interface.js +3 -0
- package/lib/codecs/composer/parse.js +3 -0
- package/lib/codecs/composer/registry.js +13 -5
- package/lib/codecs/composer.codec.js +3 -0
- package/lib/codecs/go/parse.js +65 -0
- package/lib/codecs/go/registry.js +74 -0
- package/lib/codecs/go.codec.js +76 -0
- package/lib/codecs/index.js +7 -2
- package/lib/codecs/maven/jar-scan.js +199 -0
- package/lib/codecs/maven.codec.js +17 -1
- package/lib/codecs/npm/collect.js +37 -17
- package/lib/codecs/npm/parse.js +117 -10
- package/lib/codecs/npm/registry.js +14 -5
- package/lib/codecs/npm.codec.js +4 -1
- package/lib/codecs/nuget/parse.js +3 -0
- package/lib/codecs/nuget/registry.js +11 -4
- package/lib/codecs/nuget.codec.js +7 -2
- package/lib/codecs/pypi/parse.js +111 -14
- package/lib/codecs/pypi/registry.js +24 -5
- package/lib/codecs/pypi.codec.js +30 -6
- package/lib/codecs/recipes.js +28 -1
- package/lib/codecs/ruby/parse.js +42 -0
- package/lib/codecs/ruby/registry.js +76 -0
- package/lib/codecs/ruby.codec.js +66 -0
- package/lib/codecs/select.js +3 -0
- package/lib/codecs/yarn.codec.js +3 -0
- package/lib/config.js +3 -0
- package/lib/core.js +38 -1
- package/lib/cpe.js +30 -5
- package/lib/csaf-export.js +159 -0
- package/lib/cve-download.js +3 -0
- package/lib/cve-match.js +27 -6
- package/lib/cve-report.js +157 -28
- package/lib/dep-record.js +15 -2
- package/lib/deps-descriptor.js +113 -0
- package/lib/epss.js +115 -0
- package/lib/gate.js +45 -0
- package/lib/json-export.js +110 -0
- package/lib/kev.js +88 -0
- package/lib/license-policy.js +110 -0
- package/lib/maven-license.js +52 -0
- package/lib/maven-repo.js +3 -0
- package/lib/maven-version.js +8 -3
- package/lib/nvd.js +17 -6
- package/lib/osv.js +75 -23
- package/lib/outdated.js +10 -2
- package/lib/priority.js +90 -0
- package/lib/purl.js +77 -0
- package/lib/retire.js +80 -13
- package/lib/sarif-export.js +134 -0
- package/lib/sbom-export.js +153 -0
- package/lib/scan-completeness.js +3 -0
- package/lib/snyk.js +3 -0
- package/lib/suppress.js +113 -0
- package/lib/transitive.js +6 -3
- package/lib/ui.js +90 -0
- package/package.json +49 -2
- package/CLAUDE.md +0 -147
- package/docs/ARCHITECTURE.md +0 -182
- package/docs/USAGE.md +0 -187
- package/docs/superpowers/plans/2026-05-29-codec-composer.md +0 -556
- package/docs/superpowers/plans/2026-05-29-codec-foundation.md +0 -851
- package/docs/superpowers/plans/2026-05-29-codec-nuget.md +0 -432
- package/docs/superpowers/plans/2026-05-29-codec-pypi.md +0 -450
- package/docs/superpowers/specs/2026-05-29-codecs-multi-ecosystem-design.md +0 -251
- package/test/cli-ecosystem.test.js +0 -30
- package/test/codec-edge-cases.test.js +0 -131
- package/test/codec-integration.test.js +0 -119
- package/test/codecs.test.js +0 -92
- package/test/composer.test.js +0 -71
- package/test/core.test.js +0 -153
- package/test/cpe.test.js +0 -166
- package/test/cve-download.test.js +0 -39
- package/test/cve-match.test.js +0 -217
- package/test/cve-report.test.js +0 -180
- package/test/dep-record.test.js +0 -31
- package/test/fixtures/complex-enterprise/api/pom.xml +0 -32
- package/test/fixtures/complex-enterprise/build/pom.xml +0 -46
- package/test/fixtures/complex-enterprise/dao/pom.xml +0 -37
- package/test/fixtures/complex-enterprise/pom.xml +0 -66
- package/test/fixtures/complex-enterprise/web/pom.xml +0 -77
- package/test/fixtures/csharp-config/packages.config +0 -4
- package/test/fixtures/csharp-csproj/Directory.Packages.props +0 -5
- package/test/fixtures/csharp-csproj/app.csproj +0 -7
- package/test/fixtures/csharp-lock/packages.lock.json +0 -6
- package/test/fixtures/cve-samples/cve-non-java.json +0 -19
- package/test/fixtures/cve-samples/cve-product-only.json +0 -31
- package/test/fixtures/cve-samples/cve-with-packagename.json +0 -37
- package/test/fixtures/cve-samples/nvd-log4shell.json +0 -40
- package/test/fixtures/cve-samples/nvd-npm-lodash.json +0 -22
- package/test/fixtures/monorepo-mixed/libs/common-bom/pom.xml +0 -26
- package/test/fixtures/monorepo-mixed/packages/cli/package.json +0 -14
- package/test/fixtures/monorepo-mixed/packages/cli/yarn.lock +0 -41
- package/test/fixtures/monorepo-mixed/packages/no-lock/package.json +0 -10
- package/test/fixtures/monorepo-mixed/packages/web-app/package-lock.json +0 -71
- package/test/fixtures/monorepo-mixed/packages/web-app/package.json +0 -17
- package/test/fixtures/monorepo-mixed/pom.xml +0 -29
- package/test/fixtures/monorepo-mixed/services/api/pom.xml +0 -27
- package/test/fixtures/monorepo-mixed/services/worker/pom.xml +0 -28
- package/test/fixtures/php-app/composer.json +0 -5
- package/test/fixtures/php-app/composer.lock +0 -10
- package/test/fixtures/polyglot/cs/packages.lock.json +0 -1
- package/test/fixtures/polyglot/js/package-lock.json +0 -1
- package/test/fixtures/polyglot/js/package.json +0 -1
- package/test/fixtures/polyglot/mvn/pom.xml +0 -7
- package/test/fixtures/polyglot/php/composer.lock +0 -1
- package/test/fixtures/polyglot/py/poetry.lock +0 -3
- package/test/fixtures/private-lib-detection/core/pom.xml +0 -26
- package/test/fixtures/private-lib-detection/plugin/pom.xml +0 -23
- package/test/fixtures/private-lib-detection/pom.xml +0 -35
- package/test/fixtures/python-pipenv/Pipfile.lock +0 -1
- package/test/fixtures/python-poetry/poetry.lock +0 -7
- package/test/fixtures/python-reqs/requirements.txt +0 -5
- package/test/fixtures/python-uv/uv.lock +0 -3
- package/test/fixtures/simple/app/pom.xml +0 -28
- package/test/fixtures/simple/lib/pom.xml +0 -18
- package/test/fixtures/simple/pom.xml +0 -24
- package/test/maven-repo.test.js +0 -111
- package/test/maven-version.test.js +0 -57
- package/test/monorepo.test.js +0 -132
- package/test/npm-registry.test.js +0 -64
- package/test/npm.test.js +0 -150
- package/test/nuget.test.js +0 -66
- package/test/osv.test.js +0 -62
- package/test/outdated.test.js +0 -101
- package/test/pypi.test.js +0 -72
- package/test/snyk.test.js +0 -64
- package/test/transitive.test.js +0 -305
- package/test/webjar.test.js +0 -33
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project xmlns="http://maven.apache.org/POM/4.0.0">
|
|
3
|
-
<modelVersion>4.0.0</modelVersion>
|
|
4
|
-
<parent>
|
|
5
|
-
<groupId>com.acme</groupId>
|
|
6
|
-
<artifactId>monorepo-parent</artifactId>
|
|
7
|
-
<version>1.0.0</version>
|
|
8
|
-
<relativePath>../../pom.xml</relativePath>
|
|
9
|
-
</parent>
|
|
10
|
-
<artifactId>common-bom</artifactId>
|
|
11
|
-
<packaging>pom</packaging>
|
|
12
|
-
<dependencyManagement>
|
|
13
|
-
<dependencies>
|
|
14
|
-
<dependency>
|
|
15
|
-
<groupId>com.fasterxml.jackson.core</groupId>
|
|
16
|
-
<artifactId>jackson-databind</artifactId>
|
|
17
|
-
<version>${jackson.version}</version>
|
|
18
|
-
</dependency>
|
|
19
|
-
<dependency>
|
|
20
|
-
<groupId>org.apache.logging.log4j</groupId>
|
|
21
|
-
<artifactId>log4j-core</artifactId>
|
|
22
|
-
<version>${log4j.version}</version>
|
|
23
|
-
</dependency>
|
|
24
|
-
</dependencies>
|
|
25
|
-
</dependencyManagement>
|
|
26
|
-
</project>
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
|
-
# yarn lockfile v1
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"@acme/private-utils@1.0.0":
|
|
6
|
-
version "1.0.0"
|
|
7
|
-
resolved "https://npm.acme.internal/@acme/private-utils/-/private-utils-1.0.0.tgz"
|
|
8
|
-
integrity sha512-private-fake-hash
|
|
9
|
-
|
|
10
|
-
chalk@4.1.2:
|
|
11
|
-
version "4.1.2"
|
|
12
|
-
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz"
|
|
13
|
-
integrity sha512-fake-chalk-hash
|
|
14
|
-
dependencies:
|
|
15
|
-
ansi-styles "^4.1.0"
|
|
16
|
-
supports-color "^7.1.0"
|
|
17
|
-
|
|
18
|
-
ansi-styles@^4.1.0:
|
|
19
|
-
version "4.3.0"
|
|
20
|
-
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz"
|
|
21
|
-
integrity sha512-fake-ansi-hash
|
|
22
|
-
|
|
23
|
-
supports-color@^7.1.0:
|
|
24
|
-
version "7.2.0"
|
|
25
|
-
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz"
|
|
26
|
-
integrity sha512-fake-supports-hash
|
|
27
|
-
|
|
28
|
-
mocha@9.0.0:
|
|
29
|
-
version "9.0.0"
|
|
30
|
-
resolved "https://registry.yarnpkg.com/mocha/-/mocha-9.0.0.tgz"
|
|
31
|
-
integrity sha512-fake-mocha-hash
|
|
32
|
-
|
|
33
|
-
minimist@1.2.5:
|
|
34
|
-
version "1.2.5"
|
|
35
|
-
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz"
|
|
36
|
-
integrity sha512-fake-minimist-hash
|
|
37
|
-
|
|
38
|
-
node-fetch@2.6.6:
|
|
39
|
-
version "2.6.6"
|
|
40
|
-
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.6.tgz"
|
|
41
|
-
integrity sha512-fake-nodefetch-hash
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@acme/web-app",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"lockfileVersion": 3,
|
|
5
|
-
"requires": true,
|
|
6
|
-
"packages": {
|
|
7
|
-
"": {
|
|
8
|
-
"name": "@acme/web-app",
|
|
9
|
-
"version": "1.0.0",
|
|
10
|
-
"dependencies": {
|
|
11
|
-
"axios": "0.21.0",
|
|
12
|
-
"lodash": "4.17.15",
|
|
13
|
-
"express": "4.17.1"
|
|
14
|
-
},
|
|
15
|
-
"devDependencies": {
|
|
16
|
-
"jest": "27.0.0",
|
|
17
|
-
"eslint": "7.32.0"
|
|
18
|
-
},
|
|
19
|
-
"peerDependencies": {
|
|
20
|
-
"react": "17.0.2"
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
"node_modules/axios": {
|
|
24
|
-
"version": "0.21.0",
|
|
25
|
-
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.0.tgz",
|
|
26
|
-
"integrity": "sha512-fakehash1",
|
|
27
|
-
"dependencies": { "follow-redirects": "1.13.0" }
|
|
28
|
-
},
|
|
29
|
-
"node_modules/follow-redirects": {
|
|
30
|
-
"version": "1.13.0",
|
|
31
|
-
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz",
|
|
32
|
-
"integrity": "sha512-fakehash2"
|
|
33
|
-
},
|
|
34
|
-
"node_modules/lodash": {
|
|
35
|
-
"version": "4.17.15",
|
|
36
|
-
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
|
|
37
|
-
"integrity": "sha512-fakehash3"
|
|
38
|
-
},
|
|
39
|
-
"node_modules/express": {
|
|
40
|
-
"version": "4.17.1",
|
|
41
|
-
"resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz",
|
|
42
|
-
"integrity": "sha512-fakehash4",
|
|
43
|
-
"dependencies": {
|
|
44
|
-
"qs": "6.7.0"
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
"node_modules/qs": {
|
|
48
|
-
"version": "6.7.0",
|
|
49
|
-
"resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz",
|
|
50
|
-
"integrity": "sha512-fakehash5"
|
|
51
|
-
},
|
|
52
|
-
"node_modules/jest": {
|
|
53
|
-
"version": "27.0.0",
|
|
54
|
-
"dev": true,
|
|
55
|
-
"resolved": "https://registry.npmjs.org/jest/-/jest-27.0.0.tgz",
|
|
56
|
-
"integrity": "sha512-fakehash6"
|
|
57
|
-
},
|
|
58
|
-
"node_modules/eslint": {
|
|
59
|
-
"version": "7.32.0",
|
|
60
|
-
"dev": true,
|
|
61
|
-
"resolved": "https://registry.npmjs.org/eslint/-/eslint-7.32.0.tgz",
|
|
62
|
-
"integrity": "sha512-fakehash7"
|
|
63
|
-
},
|
|
64
|
-
"node_modules/react": {
|
|
65
|
-
"version": "17.0.2",
|
|
66
|
-
"peer": true,
|
|
67
|
-
"resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz",
|
|
68
|
-
"integrity": "sha512-fakehash8"
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@acme/web-app",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"dependencies": {
|
|
6
|
-
"axios": "0.21.0",
|
|
7
|
-
"lodash": "4.17.15",
|
|
8
|
-
"express": "4.17.1"
|
|
9
|
-
},
|
|
10
|
-
"devDependencies": {
|
|
11
|
-
"jest": "27.0.0",
|
|
12
|
-
"eslint": "7.32.0"
|
|
13
|
-
},
|
|
14
|
-
"peerDependencies": {
|
|
15
|
-
"react": "17.0.2"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project xmlns="http://maven.apache.org/POM/4.0.0">
|
|
3
|
-
<modelVersion>4.0.0</modelVersion>
|
|
4
|
-
<groupId>com.acme</groupId>
|
|
5
|
-
<artifactId>monorepo-parent</artifactId>
|
|
6
|
-
<version>1.0.0</version>
|
|
7
|
-
<packaging>pom</packaging>
|
|
8
|
-
<modules>
|
|
9
|
-
<module>services/api</module>
|
|
10
|
-
<module>services/worker</module>
|
|
11
|
-
<module>libs/common-bom</module>
|
|
12
|
-
</modules>
|
|
13
|
-
<properties>
|
|
14
|
-
<jackson.version>2.9.10</jackson.version>
|
|
15
|
-
<log4j.version>2.14.0</log4j.version>
|
|
16
|
-
<spring.version>5.3.20</spring.version>
|
|
17
|
-
</properties>
|
|
18
|
-
<dependencyManagement>
|
|
19
|
-
<dependencies>
|
|
20
|
-
<dependency>
|
|
21
|
-
<groupId>com.acme</groupId>
|
|
22
|
-
<artifactId>common-bom</artifactId>
|
|
23
|
-
<version>1.0.0</version>
|
|
24
|
-
<type>pom</type>
|
|
25
|
-
<scope>import</scope>
|
|
26
|
-
</dependency>
|
|
27
|
-
</dependencies>
|
|
28
|
-
</dependencyManagement>
|
|
29
|
-
</project>
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project xmlns="http://maven.apache.org/POM/4.0.0">
|
|
3
|
-
<modelVersion>4.0.0</modelVersion>
|
|
4
|
-
<parent>
|
|
5
|
-
<groupId>com.acme</groupId>
|
|
6
|
-
<artifactId>monorepo-parent</artifactId>
|
|
7
|
-
<version>1.0.0</version>
|
|
8
|
-
<relativePath>../../pom.xml</relativePath>
|
|
9
|
-
</parent>
|
|
10
|
-
<artifactId>api</artifactId>
|
|
11
|
-
<dependencies>
|
|
12
|
-
<dependency>
|
|
13
|
-
<groupId>com.fasterxml.jackson.core</groupId>
|
|
14
|
-
<artifactId>jackson-databind</artifactId>
|
|
15
|
-
</dependency>
|
|
16
|
-
<dependency>
|
|
17
|
-
<groupId>org.springframework</groupId>
|
|
18
|
-
<artifactId>spring-web</artifactId>
|
|
19
|
-
<version>${spring.version}</version>
|
|
20
|
-
</dependency>
|
|
21
|
-
<dependency>
|
|
22
|
-
<groupId>com.acme.private</groupId>
|
|
23
|
-
<artifactId>internal-auth</artifactId>
|
|
24
|
-
<version>1.2.3</version>
|
|
25
|
-
</dependency>
|
|
26
|
-
</dependencies>
|
|
27
|
-
</project>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project xmlns="http://maven.apache.org/POM/4.0.0">
|
|
3
|
-
<modelVersion>4.0.0</modelVersion>
|
|
4
|
-
<parent>
|
|
5
|
-
<groupId>com.acme</groupId>
|
|
6
|
-
<artifactId>monorepo-parent</artifactId>
|
|
7
|
-
<version>1.0.0</version>
|
|
8
|
-
<relativePath>../../pom.xml</relativePath>
|
|
9
|
-
</parent>
|
|
10
|
-
<artifactId>worker</artifactId>
|
|
11
|
-
<dependencies>
|
|
12
|
-
<dependency>
|
|
13
|
-
<groupId>org.apache.logging.log4j</groupId>
|
|
14
|
-
<artifactId>log4j-core</artifactId>
|
|
15
|
-
</dependency>
|
|
16
|
-
<dependency>
|
|
17
|
-
<groupId>org.yaml</groupId>
|
|
18
|
-
<artifactId>snakeyaml</artifactId>
|
|
19
|
-
<version>1.30</version>
|
|
20
|
-
</dependency>
|
|
21
|
-
<dependency>
|
|
22
|
-
<groupId>junit</groupId>
|
|
23
|
-
<artifactId>junit</artifactId>
|
|
24
|
-
<version>4.12</version>
|
|
25
|
-
<scope>test</scope>
|
|
26
|
-
</dependency>
|
|
27
|
-
</dependencies>
|
|
28
|
-
</project>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"packages": [
|
|
3
|
-
{ "name": "guzzlehttp/guzzle", "version": "7.4.5" },
|
|
4
|
-
{ "name": "monolog/monolog", "version": "2.9.1" },
|
|
5
|
-
{ "name": "symfony/console", "version": "v6.2.10" }
|
|
6
|
-
],
|
|
7
|
-
"packages-dev": [
|
|
8
|
-
{ "name": "phpunit/phpunit", "version": "10.1.0" }
|
|
9
|
-
]
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{ "version":1,"dependencies":{"net6.0":{"Newtonsoft.Json":{"type":"Direct","resolved":"13.0.1"}}} }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{ "name":"poly-js","lockfileVersion":3,"packages":{"node_modules/lodash":{"version":"4.17.21"}} }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{ "name":"poly-js","dependencies":{"lodash":"^4.17.0"} }
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
<project xmlns="http://maven.apache.org/POM/4.0.0">
|
|
2
|
-
<modelVersion>4.0.0</modelVersion>
|
|
3
|
-
<groupId>com.acme</groupId><artifactId>poly</artifactId><version>1.0.0</version>
|
|
4
|
-
<dependencies>
|
|
5
|
-
<dependency><groupId>org.apache.logging.log4j</groupId><artifactId>log4j-core</artifactId><version>2.14.0</version></dependency>
|
|
6
|
-
</dependencies>
|
|
7
|
-
</project>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{ "packages":[{"name":"guzzlehttp/guzzle","version":"7.4.5"}],"packages-dev":[] }
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project xmlns="http://maven.apache.org/POM/4.0.0">
|
|
3
|
-
<modelVersion>4.0.0</modelVersion>
|
|
4
|
-
<parent>
|
|
5
|
-
<groupId>com.client.app</groupId>
|
|
6
|
-
<artifactId>secret-monolith</artifactId>
|
|
7
|
-
<version>1.0.0</version>
|
|
8
|
-
<relativePath>..</relativePath>
|
|
9
|
-
</parent>
|
|
10
|
-
<artifactId>core</artifactId>
|
|
11
|
-
<dependencies>
|
|
12
|
-
<dependency>
|
|
13
|
-
<groupId>org.springframework</groupId>
|
|
14
|
-
<artifactId>spring-context</artifactId>
|
|
15
|
-
</dependency>
|
|
16
|
-
<dependency>
|
|
17
|
-
<groupId>com.client.private</groupId>
|
|
18
|
-
<artifactId>secret-lib</artifactId>
|
|
19
|
-
</dependency>
|
|
20
|
-
<dependency>
|
|
21
|
-
<groupId>org.megacorp.private</groupId>
|
|
22
|
-
<artifactId>megacorp-utils</artifactId>
|
|
23
|
-
<version>2.1.0</version>
|
|
24
|
-
</dependency>
|
|
25
|
-
</dependencies>
|
|
26
|
-
</project>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project xmlns="http://maven.apache.org/POM/4.0.0">
|
|
3
|
-
<modelVersion>4.0.0</modelVersion>
|
|
4
|
-
<parent>
|
|
5
|
-
<groupId>com.client.app</groupId>
|
|
6
|
-
<artifactId>secret-monolith</artifactId>
|
|
7
|
-
<version>1.0.0</version>
|
|
8
|
-
<relativePath>..</relativePath>
|
|
9
|
-
</parent>
|
|
10
|
-
<artifactId>plugin</artifactId>
|
|
11
|
-
<dependencies>
|
|
12
|
-
<dependency>
|
|
13
|
-
<groupId>com.client.app</groupId>
|
|
14
|
-
<artifactId>core</artifactId>
|
|
15
|
-
<version>1.0.0</version>
|
|
16
|
-
</dependency>
|
|
17
|
-
<dependency>
|
|
18
|
-
<groupId>com.googlecode.json-simple</groupId>
|
|
19
|
-
<artifactId>json-simple</artifactId>
|
|
20
|
-
<version>1.1.1</version>
|
|
21
|
-
</dependency>
|
|
22
|
-
</dependencies>
|
|
23
|
-
</project>
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project xmlns="http://maven.apache.org/POM/4.0.0">
|
|
3
|
-
<modelVersion>4.0.0</modelVersion>
|
|
4
|
-
<parent>
|
|
5
|
-
<groupId>org.megacorp.parents</groupId>
|
|
6
|
-
<artifactId>megacorp-super-parent</artifactId>
|
|
7
|
-
<version>9.9.9-PRIVATE</version>
|
|
8
|
-
</parent>
|
|
9
|
-
<groupId>com.client.app</groupId>
|
|
10
|
-
<artifactId>secret-monolith</artifactId>
|
|
11
|
-
<version>1.0.0</version>
|
|
12
|
-
<packaging>pom</packaging>
|
|
13
|
-
<modules>
|
|
14
|
-
<module>core</module>
|
|
15
|
-
<module>plugin</module>
|
|
16
|
-
</modules>
|
|
17
|
-
<properties>
|
|
18
|
-
<spring.version>5.3.30</spring.version>
|
|
19
|
-
<secret-lib.version>1.0.0-CLIENT</secret-lib.version>
|
|
20
|
-
</properties>
|
|
21
|
-
<dependencyManagement>
|
|
22
|
-
<dependencies>
|
|
23
|
-
<dependency>
|
|
24
|
-
<groupId>com.client.private</groupId>
|
|
25
|
-
<artifactId>secret-lib</artifactId>
|
|
26
|
-
<version>${secret-lib.version}</version>
|
|
27
|
-
</dependency>
|
|
28
|
-
<dependency>
|
|
29
|
-
<groupId>org.springframework</groupId>
|
|
30
|
-
<artifactId>spring-context</artifactId>
|
|
31
|
-
<version>${spring.version}</version>
|
|
32
|
-
</dependency>
|
|
33
|
-
</dependencies>
|
|
34
|
-
</dependencyManagement>
|
|
35
|
-
</project>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{ "default": { "django": { "version": "==4.2.0" } }, "develop": { "pytest": { "version": "==7.4.0" } } }
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project xmlns="http://maven.apache.org/POM/4.0.0">
|
|
3
|
-
<modelVersion>4.0.0</modelVersion>
|
|
4
|
-
<parent>
|
|
5
|
-
<groupId>com.example.simple</groupId>
|
|
6
|
-
<artifactId>simple-parent</artifactId>
|
|
7
|
-
<version>1.0.0</version>
|
|
8
|
-
<relativePath>..</relativePath>
|
|
9
|
-
</parent>
|
|
10
|
-
<artifactId>app</artifactId>
|
|
11
|
-
<dependencies>
|
|
12
|
-
<dependency>
|
|
13
|
-
<groupId>com.fasterxml.jackson.core</groupId>
|
|
14
|
-
<artifactId>jackson-databind</artifactId>
|
|
15
|
-
</dependency>
|
|
16
|
-
<dependency>
|
|
17
|
-
<groupId>com.example.simple</groupId>
|
|
18
|
-
<artifactId>lib</artifactId>
|
|
19
|
-
<version>1.0.0</version>
|
|
20
|
-
</dependency>
|
|
21
|
-
<dependency>
|
|
22
|
-
<groupId>junit</groupId>
|
|
23
|
-
<artifactId>junit</artifactId>
|
|
24
|
-
<version>4.13.2</version>
|
|
25
|
-
<scope>test</scope>
|
|
26
|
-
</dependency>
|
|
27
|
-
</dependencies>
|
|
28
|
-
</project>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project xmlns="http://maven.apache.org/POM/4.0.0">
|
|
3
|
-
<modelVersion>4.0.0</modelVersion>
|
|
4
|
-
<parent>
|
|
5
|
-
<groupId>com.example.simple</groupId>
|
|
6
|
-
<artifactId>simple-parent</artifactId>
|
|
7
|
-
<version>1.0.0</version>
|
|
8
|
-
<relativePath>..</relativePath>
|
|
9
|
-
</parent>
|
|
10
|
-
<artifactId>lib</artifactId>
|
|
11
|
-
<dependencies>
|
|
12
|
-
<dependency>
|
|
13
|
-
<groupId>org.apache.commons</groupId>
|
|
14
|
-
<artifactId>commons-lang3</artifactId>
|
|
15
|
-
<version>3.14.0</version>
|
|
16
|
-
</dependency>
|
|
17
|
-
</dependencies>
|
|
18
|
-
</project>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project xmlns="http://maven.apache.org/POM/4.0.0">
|
|
3
|
-
<modelVersion>4.0.0</modelVersion>
|
|
4
|
-
<groupId>com.example.simple</groupId>
|
|
5
|
-
<artifactId>simple-parent</artifactId>
|
|
6
|
-
<version>1.0.0</version>
|
|
7
|
-
<packaging>pom</packaging>
|
|
8
|
-
<modules>
|
|
9
|
-
<module>app</module>
|
|
10
|
-
<module>lib</module>
|
|
11
|
-
</modules>
|
|
12
|
-
<properties>
|
|
13
|
-
<jackson.version>2.16.0</jackson.version>
|
|
14
|
-
</properties>
|
|
15
|
-
<dependencyManagement>
|
|
16
|
-
<dependencies>
|
|
17
|
-
<dependency>
|
|
18
|
-
<groupId>com.fasterxml.jackson.core</groupId>
|
|
19
|
-
<artifactId>jackson-databind</artifactId>
|
|
20
|
-
<version>${jackson.version}</version>
|
|
21
|
-
</dependency>
|
|
22
|
-
</dependencies>
|
|
23
|
-
</dependencyManagement>
|
|
24
|
-
</project>
|
package/test/maven-repo.test.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
const { test } = require("node:test");
|
|
2
|
-
const assert = require("node:assert/strict");
|
|
3
|
-
const {
|
|
4
|
-
buildRepoList,
|
|
5
|
-
splitUrlAuth,
|
|
6
|
-
authHeader,
|
|
7
|
-
tryRepos,
|
|
8
|
-
fetchPomFromRepos,
|
|
9
|
-
fetchMavenMetadata,
|
|
10
|
-
MAVEN_CENTRAL,
|
|
11
|
-
} = require("../lib/maven-repo");
|
|
12
|
-
|
|
13
|
-
test("splitUrlAuth pulls user:pass out of a URL", () => {
|
|
14
|
-
const { url, auth } = splitUrlAuth("https://alice:s3cr3t@nexus.acme.com/repository/maven-public/");
|
|
15
|
-
assert.equal(auth, "alice:s3cr3t");
|
|
16
|
-
assert.ok(!/alice:s3cr3t/.test(url));
|
|
17
|
-
assert.ok(url.startsWith("https://nexus.acme.com/"));
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
test("splitUrlAuth no-op when URL has no auth", () => {
|
|
21
|
-
const { url, auth } = splitUrlAuth("https://repo1.maven.org/maven2/");
|
|
22
|
-
assert.equal(auth, null);
|
|
23
|
-
assert.equal(url, "https://repo1.maven.org/maven2/");
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
test("authHeader returns Basic <base64>", () => {
|
|
27
|
-
assert.equal(authHeader("alice:s3cr3t"), "Basic " + Buffer.from("alice:s3cr3t").toString("base64"));
|
|
28
|
-
assert.equal(authHeader(null), null);
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
test("buildRepoList puts user repos first, Central last, dedupes by URL, normalises trailing slash", () => {
|
|
32
|
-
const list = buildRepoList(
|
|
33
|
-
[
|
|
34
|
-
{ name: "nexus", url: "https://nexus.acme.com/repository/maven-public" }, // no trailing /
|
|
35
|
-
{ name: "jboss", url: "https://repository.jboss.org/nexus/content/groups/public/" },
|
|
36
|
-
],
|
|
37
|
-
[
|
|
38
|
-
{ url: "https://nexus.acme.com/repository/maven-public/" }, // dup, with trailing /
|
|
39
|
-
{ url: "https://maven.atlassian.com/" },
|
|
40
|
-
],
|
|
41
|
-
);
|
|
42
|
-
assert.equal(list[0].name, "nexus");
|
|
43
|
-
assert.equal(list[0].url, "https://nexus.acme.com/repository/maven-public/");
|
|
44
|
-
assert.equal(list[1].name, "jboss");
|
|
45
|
-
// The dup of "nexus" is dropped
|
|
46
|
-
assert.equal(list.filter(r => r.name === "nexus").length, 1);
|
|
47
|
-
// atlassian is in the middle (extra repo, before Central)
|
|
48
|
-
assert.ok(list.some(r => r.url === "https://maven.atlassian.com/"));
|
|
49
|
-
// Maven Central is last
|
|
50
|
-
assert.equal(list[list.length - 1].url, MAVEN_CENTRAL.url);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
test("buildRepoList strips and stores embedded user:pass auth", () => {
|
|
54
|
-
const list = buildRepoList([
|
|
55
|
-
{ name: "private", url: "https://bob:hunter2@nexus.acme.com/repository/private/" },
|
|
56
|
-
]);
|
|
57
|
-
assert.equal(list[0].url, "https://nexus.acme.com/repository/private/");
|
|
58
|
-
assert.equal(list[0].auth, "bob:hunter2");
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
test("tryRepos returns the first 2xx, skipping 404s", async () => {
|
|
62
|
-
const calls = [];
|
|
63
|
-
const fetcher = async (url) => {
|
|
64
|
-
calls.push(url);
|
|
65
|
-
if (url.startsWith("https://nexus.acme/")) return { ok: false, status: 404 };
|
|
66
|
-
if (url.startsWith("https://repo1.maven.org/")) return { ok: true, status: 200, text: async () => "<project/>" };
|
|
67
|
-
return { ok: false, status: 500 };
|
|
68
|
-
};
|
|
69
|
-
const repos = buildRepoList([{ name: "nexus", url: "https://nexus.acme/" }]);
|
|
70
|
-
const hit = await tryRepos(repos, "log4j/log4j/1.2.17/log4j-1.2.17.pom", { fetcher, readBody: true });
|
|
71
|
-
assert.ok(hit, "should hit Central after Nexus 404");
|
|
72
|
-
assert.equal(hit.repo.url, MAVEN_CENTRAL.url);
|
|
73
|
-
assert.equal(hit.body, "<project/>");
|
|
74
|
-
assert.equal(calls.length, 2);
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
test("tryRepos returns null when no repo answers 2xx", async () => {
|
|
78
|
-
const fetcher = async () => ({ ok: false, status: 404 });
|
|
79
|
-
const repos = buildRepoList([{ name: "a", url: "https://a.example/" }, { name: "b", url: "https://b.example/" }]);
|
|
80
|
-
const hit = await tryRepos(repos, "g/a/1/a-1.pom", { fetcher });
|
|
81
|
-
assert.equal(hit, null);
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
test("tryRepos sends Basic auth header for repos with creds", async () => {
|
|
85
|
-
let seenAuth = null;
|
|
86
|
-
const fetcher = async (url, init) => {
|
|
87
|
-
seenAuth = init?.headers?.Authorization || null;
|
|
88
|
-
return { ok: true, status: 200, text: async () => "ok" };
|
|
89
|
-
};
|
|
90
|
-
const repos = buildRepoList([{ name: "p", url: "https://x:y@nexus.acme/" }]);
|
|
91
|
-
await tryRepos(repos, "g/a/1/a-1.pom", { fetcher });
|
|
92
|
-
assert.equal(seenAuth, "Basic " + Buffer.from("x:y").toString("base64"));
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
test("fetchPomFromRepos constructs the standard Maven path", async () => {
|
|
96
|
-
const seen = [];
|
|
97
|
-
const fetcher = async (url) => { seen.push(url); return { ok: false, status: 404 }; };
|
|
98
|
-
const repos = buildRepoList([{ name: "a", url: "https://a.example/" }]);
|
|
99
|
-
await fetchPomFromRepos(repos, "org.apache.logging.log4j", "log4j-core", "2.17.0", { fetcher });
|
|
100
|
-
assert.ok(seen[0].endsWith("org/apache/logging/log4j/log4j-core/2.17.0/log4j-core-2.17.0.pom"),
|
|
101
|
-
`unexpected URL: ${seen[0]}`);
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
test("fetchMavenMetadata hits the maven-metadata.xml path", async () => {
|
|
105
|
-
const seen = [];
|
|
106
|
-
const fetcher = async (url) => { seen.push(url); return { ok: false, status: 404 }; };
|
|
107
|
-
const repos = buildRepoList([{ name: "a", url: "https://a.example/" }]);
|
|
108
|
-
await fetchMavenMetadata(repos, "org.apache.logging.log4j", "log4j-core", { fetcher });
|
|
109
|
-
assert.ok(seen[0].endsWith("org/apache/logging/log4j/log4j-core/maven-metadata.xml"),
|
|
110
|
-
`unexpected URL: ${seen[0]}`);
|
|
111
|
-
});
|