Skip to content

Omit ingestion metadata from /search records - #183

Merged
jdaigneau5 merged 2 commits into
devfrom
af/177-record-metadata-cleanup
Oct 14, 2026
Merged

jdaigneau5 merged 2 commits into
devfrom
af/177-record-metadata-cleanup

Conversation

@afoote-mitre

@afoote-mitre afoote-mitre commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes #177. /search returned the indexed _source unchanged, exposing the internal opensearch_ops object inside otherwise complete CVE Records. This contradicted the documented response and introduced an extra top-level property that is not part of the CVE Record schema.

Why These Changes Were Needed

Change Primary files Reason
Omit top-level ingestion metadata at the public response boundary utils/searchResponseBuilder.js Copies each returned record without opensearch_ops, including its ingestion timestamps and signatures. The shared builder covers both direct searches and semantic searches after full-record retrieval, without mutating the indexed source or introducing a restrictive field allowlist.
Cover removal and record preservation utils/searchResponseBuilder.test.js, routes/search.integration.test.js, controllers/searchController.test.js Exercises published and rejected states, preserves CNA/ADP and other fields, checks source immutability, and verifies direct and semantic response paths.
Clarify response documentation README.md, routes/swagger.js, generated api-docs/openapi.json Explicitly describes the omitted ingestion field and distinguishes this targeted cleanup from CVE JSON schema validation or record repair.

@jdaigneau5
jdaigneau5 merged commit 82600b8 into dev Oct 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants