Documentation
¶
Overview ¶
Package client is a thin HTTP client for the DevRadar SBOM ingest API.
Index ¶
Constants ¶
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 image tag (e.g. "v1.20.2"), optional.
Version string
// Labels are tenant grouping labels (e.g. "team-x", "prod"), optional.
Labels []string
// Attestation is the raw (un-encoded) sigstore/cosign bundle, optional. When
// present it is base64-encoded on the wire; the service verifies it (if a
// trust policy is configured) and reports the outcome in
// SubmitResponse.VerificationStatus.
Attestation []byte
}
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.
type SubmitResponse ¶
type SubmitResponse struct {
SBOMID string `json:"sbom_id"`
ImageRef string `json:"image_ref"`
Digest string `json:"digest"`
Format string `json:"format"`
Existing bool `json:"existing"`
// VerificationStatus is the attestation outcome: unverified | verified | failed.
VerificationStatus string `json:"verification_status"`
}
SubmitResponse mirrors the POST /v1/sboms response body.