Accept inline SBOM documents in mirror API - #294
Open
abhinavgautam01 wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for starting mirror jobs by submitting an inline CycloneDX/SPDX SBOM document to POST /api/mirror, enabling CI workflows to warm the proxy cache without writing SBOM files to disk.
Changes:
- Extend
mirror.JobRequestwith ansbomfield and createSBOMSourcefrom inline SBOM bytes. - Refactor
SBOMSourceto consume raw bytes (and move SBOM file reads into theproxy mirrorCLI). - Add tests and update documentation/examples for inline SBOM mirror requests.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents inline SBOM usage and updates the Mirror API endpoint description. |
| docs/configuration.md | Adds an inline SBOM example for the Mirror API configuration docs. |
| internal/server/mirror_api_test.go | Adds an API test covering job creation from inline SBOM JSON. |
| internal/mirror/job.go | Adds sbom to JobRequest and enables SBOM-backed job sources. |
| internal/mirror/job_test.go | Adds a unit test validating SBOM requests map to SBOMSource. |
| internal/mirror/source.go | Refactors SBOMSource from path-based reads to byte-backed parsing. |
| internal/mirror/source_test.go | Updates SBOM parsing tests to use in-memory bytes instead of temp files. |
| cmd/proxy/main.go | Moves SBOM file reading into the CLI and passes bytes into SBOMSource. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #145
Summary
Add support for submitting raw CycloneDX or SPDX JSON documents directly to
POST /api/mirror.This allows CI jobs to warm the proxy cache from an SBOM without creating a temporary file or invoking the CLI.
Changes
sbomfield tomirror.JobRequestSBOMSourcefrom inline SBOM data received by the APISBOMSourceto consume raw bytes instead of reading filesproxy mirrorCLIExample
Validation