How interlynk-io/sbommv works
Project Overview
• sbommv is a command-line tool designed for transferring SBOMs (Software Bills of Materials) between Source (input adapters) and Target systems (output adapters).
• The tool’s extensibility leverages an adapter-based design, with existing adapters for GitHub and folder as input sources and for Interlynk (and in future, Dependency-Track and others) as output destinations.
• The README further illustrates the data flow: inputs → enrichment/translation (conversion) → outputs.
Main Components
a. Command-Line Interface (CLI):
• Represented by the “cmd” directory (cmd/root.go, cmd/transfer.go, cmd/version.go) and main.go.
• This is the entry point where commands are parsed and the transfer process is invoked.
b. Input Adapters:
• Located under pkg/source, supporting folders and GitHub (pkg/source/folder and pkg/source/github).
• These components are responsible for fetching and reading SBOMs.
c. Transformation / Enrichment Layer:
• Although noted as “coming soon” for enrichment/translation, the conversion process is hinted at with pkg/converter (including file spdx22tospdx23.go).
• This as the intermediary “Enrichment/Translation Module” that standardizes or enriches the SBOM data.
d. Core Engine / Transfer Logic:
• The “pkg/engine” contains business logic for transferring the data from input to output adapters.
• Also, the pkg/tcontext and pkg/iterator indicate context management and iteration over fetched SBOMs.
e. Output Adapters:
• Implemented under pkg/target, including folders, interlynk (and a stub for dependencytrack).
• These handle the complexity of uploading or reporting the collected SBOMs to target systems.
f. Supporting Utilities:
• The “pkg/logger” for logging, “pkg/monitor” for monitoring, and various utility packages (pkg/utils, pkg/types) support the system.
• Optionally, include these components or represent them as side services that support the main data flow through cross-cutting concerns like logging and error handling.
Architectural Patterns & Design Principles
• Adapter-based architecture:
• Each adapter (input or output) abstracts external systems.
• The Transfer Engine decouples the overall logic from specific implementations.
• It shows a modular, loosely-coupled design, where adding a new adapter would plug into the system without affecting others.
Relevant Technologies & Frameworks
• The project is written in Go, as can be seen from go.mod, go.sum, and directory structure.
• GitHub Actions workflows (in .github/workflows) and Dockerfile indicate CI/CD and containerization support.
• Tools like Make (Makefile) and GoReleaser configuration (.goreleaser.yaml) support the build and deployment practices.