Skip to content

Accept SBOM body in POST /api/mirror #145

Closed

Description

@andrew

proxy mirror --sbom path.json works from the CLI but POST /api/mirror only accepts {"purls": [...]} — JobRequest in internal/mirror/job.go has no SBOM field and sourceFromRequest rejects anything else.

Add an sbom field to JobRequest that takes the raw document inline:

{"sbom": {"bomFormat": "CycloneDX", "components": [...]}}

SBOMSource currently does os.ReadFile(s.Path) then passes []byte to the extract functions, so the change is splitting that into a Data []byte field and moving the file read up to the CLI caller. sourceFromRequest then returns &SBOMSource{Data: req.SBOM} when the field is set.

This lets CI jobs post their build's SBOM straight to the proxy to warm the cache without writing a temp file or shelling out.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions