Documentation
¶
Overview ¶
Package client is a thin HTTP client for the DevRadar SBOM ingest API.
Index ¶
Constants ¶
View Source
const DefaultBaseURL = "https://devradar.thingz.io"
DefaultBaseURL is the public DevRadar service used when none is configured.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client submits SBOMs to a DevRadar service.
func New ¶
New returns a Client targeting baseURL (trailing slashes trimmed; falls back to DefaultBaseURL when empty) authenticating with the given bearer token.
func (*Client) Submit ¶
func (c *Client) Submit(ctx context.Context, in SubmitRequest) (*SubmitResponse, error)
Submit posts an SBOM to {baseURL}/v1/sboms and returns the decoded response. A non-2xx status is returned as an error including the response body.
type SubmitRequest ¶
type SubmitRequest struct {
// SBOM is the raw (un-encoded) SBOM document. It is base64-encoded on the wire.
SBOM []byte
// ImageRef is the digest-pinned image reference (repo@sha256:…), optional.
ImageRef string
// Version is the human tag (e.g. "v1.20.2"), optional.
Version string
// Tags are tenant grouping labels (e.g. "team-x", "prod"), optional.
Tags []string
}
SubmitRequest mirrors the POST /v1/sboms request body. Only SBOM is required; the rest override the service's own parsing of the SBOM when it is weak.
Click to show internal directories.
Click to hide internal directories.