@mitre/hdf-fixtures 3.6.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/README.md +132 -0
- package/baseline/win2022-stig.json +671 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/inspec/container-scan.json +32281 -0
- package/inspec/three-layer-overlay.json +47551 -0
- package/inspec/three-layer-rhel7.json +47551 -0
- package/inspec/ubi9-scan.json +1 -0
- package/inspec/wrapper.json +1 -0
- package/package.json +39 -0
- package/results/inspec-multilayered.json +94427 -0
- package/results/minimal.json +44 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//#region src/index.d.ts
|
|
2
|
+
interface FixtureRef {
|
|
3
|
+
path: string;
|
|
4
|
+
read: () => string;
|
|
5
|
+
}
|
|
6
|
+
declare const results: {
|
|
7
|
+
readonly inspecMultilayered: FixtureRef;
|
|
8
|
+
readonly minimal: FixtureRef;
|
|
9
|
+
};
|
|
10
|
+
declare const baseline: {
|
|
11
|
+
readonly win2022Stig: FixtureRef;
|
|
12
|
+
};
|
|
13
|
+
declare const amendments: {
|
|
14
|
+
readonly uc01Fixed: FixtureRef;
|
|
15
|
+
readonly multiCve: FixtureRef;
|
|
16
|
+
};
|
|
17
|
+
declare const inspec: {
|
|
18
|
+
readonly ubi9Scan: FixtureRef;
|
|
19
|
+
readonly containerScan: FixtureRef;
|
|
20
|
+
readonly threeLayerOverlay: FixtureRef;
|
|
21
|
+
readonly threeLayerRhel7: FixtureRef;
|
|
22
|
+
readonly wrapper: FixtureRef;
|
|
23
|
+
};
|
|
24
|
+
declare const all: {
|
|
25
|
+
readonly results: {
|
|
26
|
+
readonly inspecMultilayered: FixtureRef;
|
|
27
|
+
readonly minimal: FixtureRef;
|
|
28
|
+
};
|
|
29
|
+
readonly baseline: {
|
|
30
|
+
readonly win2022Stig: FixtureRef;
|
|
31
|
+
};
|
|
32
|
+
readonly amendments: {
|
|
33
|
+
readonly uc01Fixed: FixtureRef;
|
|
34
|
+
readonly multiCve: FixtureRef;
|
|
35
|
+
};
|
|
36
|
+
readonly inspec: {
|
|
37
|
+
readonly ubi9Scan: FixtureRef;
|
|
38
|
+
readonly containerScan: FixtureRef;
|
|
39
|
+
readonly threeLayerOverlay: FixtureRef;
|
|
40
|
+
readonly threeLayerRhel7: FixtureRef;
|
|
41
|
+
readonly wrapper: FixtureRef;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
//#endregion
|
|
45
|
+
export { all, amendments, baseline, inspec, results };
|
|
46
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";UA0BU;EACR;EACA;;cAYW;+BAAA;oBAAA;;cAMA;wBAAA;;cAKA;sBAAA;qBAAA;;cAQA;;;;;;;cAQA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
//#region src/index.ts
|
|
5
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
const PACKAGE_ROOT = path.resolve(__dirname, "..");
|
|
7
|
+
function fixture(category, name) {
|
|
8
|
+
const filePath = path.join(PACKAGE_ROOT, category, name);
|
|
9
|
+
return {
|
|
10
|
+
path: filePath,
|
|
11
|
+
read: () => readFileSync(filePath, "utf-8")
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
const results = {
|
|
15
|
+
inspecMultilayered: fixture("results", "inspec-multilayered.json"),
|
|
16
|
+
minimal: fixture("results", "minimal.json")
|
|
17
|
+
};
|
|
18
|
+
const baseline = { win2022Stig: fixture("baseline", "win2022-stig.json") };
|
|
19
|
+
const amendments = {
|
|
20
|
+
uc01Fixed: fixture("amendments", "uc-01-fixed-amendments.json"),
|
|
21
|
+
multiCve: fixture("amendments", "multi-cve-amendments.json")
|
|
22
|
+
};
|
|
23
|
+
const inspec = {
|
|
24
|
+
ubi9Scan: fixture("inspec", "ubi9-scan.json"),
|
|
25
|
+
containerScan: fixture("inspec", "container-scan.json"),
|
|
26
|
+
threeLayerOverlay: fixture("inspec", "three-layer-overlay.json"),
|
|
27
|
+
threeLayerRhel7: fixture("inspec", "three-layer-rhel7.json"),
|
|
28
|
+
wrapper: fixture("inspec", "wrapper.json")
|
|
29
|
+
};
|
|
30
|
+
const all = {
|
|
31
|
+
results,
|
|
32
|
+
baseline,
|
|
33
|
+
amendments,
|
|
34
|
+
inspec
|
|
35
|
+
};
|
|
36
|
+
//#endregion
|
|
37
|
+
export { all, amendments, baseline, inspec, results };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["// @mitre/hdf-fixtures — shared real-world HDF reference data for cross-package\n// consumers (parsers, validators, hdf-extension-graph). Each entry exposes the\n// on-disk path AND a read() helper. Both Go and TS test code reach the same\n// physical files via the parallel APIs (this module + ../fixtures.go).\n//\n// Boundary rule (per bead hdf-libs-e95o): converter fixtures stay with the\n// converter as its tested contract; files here are wild-data references for\n// cross-cutting tests. Inclusion requires the fixture is actually consumed\n// by more than one workspace package — not just \"might be useful someday.\"\n//\n// Layout: top-level directories are by HDF document type (`results/`,\n// `baseline/`, `amendments/`) plus `inspec/` for InSpec runner output (non-HDF;\n// kept for cross-language parser parity tests verifying both languages\n// reject non-HDF inputs the same way).\n//\n// Provenance for every fixture is documented in ../README.md.\nimport { readFileSync } from 'node:fs';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\n// Compute paths relative to the package root, not the dist/ output dir, so\n// fixtures resolve correctly both in dev (running tsx) and after bundling.\nconst PACKAGE_ROOT = path.resolve(__dirname, '..');\n\ninterface FixtureRef {\n path: string;\n read: () => string;\n}\n\nfunction fixture(category: string, name: string): FixtureRef {\n const filePath = path.join(PACKAGE_ROOT, category, name);\n return {\n path: filePath,\n read: () => readFileSync(filePath, 'utf-8'),\n };\n}\n\n// HDF Results documents.\nexport const results = {\n inspecMultilayered: fixture('results', 'inspec-multilayered.json'),\n minimal: fixture('results', 'minimal.json'),\n} as const;\n\n// HDF Baseline documents.\nexport const baseline = {\n win2022Stig: fixture('baseline', 'win2022-stig.json'),\n} as const;\n\n// HDF Amendments documents.\nexport const amendments = {\n uc01Fixed: fixture('amendments', 'uc-01-fixed-amendments.json'),\n multiCve: fixture('amendments', 'multi-cve-amendments.json'),\n} as const;\n\n// InSpec runner output — NOT HDF. Kept here for cross-language parser\n// parity tests that verify both Go and TS parsers reject non-HDF inputs the\n// same way, and for the legacyhdf-to-hdf converter (its tests load these too).\nexport const inspec = {\n ubi9Scan: fixture('inspec', 'ubi9-scan.json'),\n containerScan: fixture('inspec', 'container-scan.json'),\n threeLayerOverlay: fixture('inspec', 'three-layer-overlay.json'),\n threeLayerRhel7: fixture('inspec', 'three-layer-rhel7.json'),\n wrapper: fixture('inspec', 'wrapper.json'),\n} as const;\n\nexport const all = {\n results,\n baseline,\n amendments,\n inspec,\n} as const;\n"],"mappings":";;;;AAoBA,MAAM,YAAY,KAAK,QAAQ,cAAc,OAAO,KAAK,GAAG,CAAC;AAI7D,MAAM,eAAe,KAAK,QAAQ,WAAW,IAAI;AAOjD,SAAS,QAAQ,UAAkB,MAA0B;CAC3D,MAAM,WAAW,KAAK,KAAK,cAAc,UAAU,IAAI;CACvD,OAAO;EACL,MAAM;EACN,YAAY,aAAa,UAAU,OAAO;CAC5C;AACF;AAGA,MAAa,UAAU;CACrB,oBAAoB,QAAQ,WAAW,0BAA0B;CACjE,SAAS,QAAQ,WAAW,cAAc;AAC5C;AAGA,MAAa,WAAW,EACtB,aAAa,QAAQ,YAAY,mBAAmB,EACtD;AAGA,MAAa,aAAa;CACxB,WAAW,QAAQ,cAAc,6BAA6B;CAC9D,UAAU,QAAQ,cAAc,2BAA2B;AAC7D;AAKA,MAAa,SAAS;CACpB,UAAU,QAAQ,UAAU,gBAAgB;CAC5C,eAAe,QAAQ,UAAU,qBAAqB;CACtD,mBAAmB,QAAQ,UAAU,0BAA0B;CAC/D,iBAAiB,QAAQ,UAAU,wBAAwB;CAC3D,SAAS,QAAQ,UAAU,cAAc;AAC3C;AAEA,MAAa,MAAM;CACjB;CACA;CACA;CACA;AACF"}
|