Add unit tests and implementations for MongoDB index models and OpenAPI metadata
- Implemented `MongoIndexModelTests` to verify index models for various stores. - Created `OpenApiMetadataFactory` with methods to generate OpenAPI metadata. - Added tests for `OpenApiMetadataFactory` to ensure expected defaults and URL overrides. - Introduced `ObserverSurfaceSecrets` and `WebhookSurfaceSecrets` for managing secrets. - Developed `RuntimeSurfaceFsClient` and `WebhookSurfaceFsClient` for manifest retrieval. - Added dependency injection tests for `SurfaceEnvironmentRegistration` in both Observer and Webhook contexts. - Implemented tests for secret resolution in `ObserverSurfaceSecretsTests` and `WebhookSurfaceSecretsTests`. - Created `EnsureLinkNotMergeCollectionsMigrationTests` to validate MongoDB migration logic. - Added project files for MongoDB tests and NuGet package mirroring.
This commit is contained in:
20
docs/samples/lnm/linkset-ghsa.json
Normal file
20
docs/samples/lnm/linkset-ghsa.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"_id": "0000000000000000000000aa",
|
||||
"tenantId": "demo-tenant",
|
||||
"source": "ghsa",
|
||||
"advisoryId": "GHSA-xxxx-yyyy",
|
||||
"observations": [ "000000000000000000000001" ],
|
||||
"normalized": {
|
||||
"purls": [ "pkg:npm/example" ],
|
||||
"versions": [ "1.2.3" ],
|
||||
"ranges": [ { "type": "semver", "events": [ { "introduced": "0" }, { "fixed": "1.2.4" } ] } ],
|
||||
"severities": [ { "system": "cvssv3.1", "score": 7.5, "vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N" } ]
|
||||
},
|
||||
"createdAt": "2025-10-06T12:05:00Z",
|
||||
"builtByJobId": "linkset-builder-456",
|
||||
"provenance": {
|
||||
"observationHashes": [ "sha256:abc123" ],
|
||||
"toolVersion": "lnm-1.0.0",
|
||||
"policyHash": "sha256:def456"
|
||||
}
|
||||
}
|
||||
24
docs/samples/lnm/observation-ghsa.json
Normal file
24
docs/samples/lnm/observation-ghsa.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"_id": "000000000000000000000001",
|
||||
"tenantId": "demo-tenant",
|
||||
"source": "ghsa",
|
||||
"advisoryId": "GHSA-xxxx-yyyy",
|
||||
"title": "Example GHSA vuln",
|
||||
"summary": "Example summary",
|
||||
"severities": [ { "system": "cvssv3.1", "score": 7.5, "vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N" } ],
|
||||
"affected": [ {
|
||||
"purl": "pkg:npm/example@1.2.3",
|
||||
"versions": [ "1.2.3" ],
|
||||
"ranges": [ { "type": "semver", "events": [ { "introduced": "0" }, { "fixed": "1.2.4" } ] } ]
|
||||
} ],
|
||||
"references": [ "https://github.com/example/advisory" ],
|
||||
"weaknesses": [ "CWE-79" ],
|
||||
"published": "2025-10-01T00:00:00Z",
|
||||
"modified": "2025-10-05T00:00:00Z",
|
||||
"provenance": {
|
||||
"sourceArtifactSha": "sha256:abc123",
|
||||
"fetchedAt": "2025-10-06T12:00:00Z",
|
||||
"ingestJobId": "ingest-123"
|
||||
},
|
||||
"ingestedAt": "2025-10-06T12:01:00Z"
|
||||
}
|
||||
Reference in New Issue
Block a user