attestations

package
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package attestations implements GitLab build attestation operations for projects including list and download.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDownloadMarkdown

func FormatDownloadMarkdown(o DownloadOutput) string

FormatDownloadMarkdown renders a download result as Markdown.

func FormatListMarkdown

func FormatListMarkdown(out ListOutput) string

FormatListMarkdown renders a list of attestations as a Markdown table.

func FormatOutputMarkdown

func FormatOutputMarkdown(o Output) string

FormatOutputMarkdown renders a single attestation as Markdown.

func RegisterTools

func RegisterTools(server *mcp.Server, client *gitlabclient.Client)

RegisterTools registers MCP tools for GitLab attestation operations.

Types

type DownloadInput

type DownloadInput struct {
	ProjectID      toolutil.StringOrInt `json:"project_id"       jsonschema:"Project ID or URL-encoded path,required"`
	AttestationIID int64                `json:"attestation_iid"  jsonschema:"Attestation IID (project-scoped),required"`
}

DownloadInput holds parameters for downloading a single attestation.

type DownloadOutput

type DownloadOutput struct {
	toolutil.HintableOutput
	AttestationIID int64  `json:"attestation_iid"`
	Size           int    `json:"size"`
	ContentBase64  string `json:"content_base64"`
}

DownloadOutput holds the downloaded attestation content.

func Download

func Download(ctx context.Context, client *gitlabclient.Client, in DownloadInput) (DownloadOutput, error)

Download retrieves the binary content of an attestation.

type ListInput

type ListInput struct {
	ProjectID     toolutil.StringOrInt `json:"project_id"      jsonschema:"Project ID or URL-encoded path,required"`
	SubjectDigest string               `json:"subject_digest"  jsonschema:"Subject digest (hash) to filter attestations,required"`
}

ListInput holds parameters for listing attestations.

type ListOutput

type ListOutput struct {
	toolutil.HintableOutput
	Attestations []Output `json:"attestations"`
}

ListOutput holds the list response.

func List

func List(ctx context.Context, client *gitlabclient.Client, in ListInput) (ListOutput, error)

List returns all attestations for a project matching a subject digest.

type Output

type Output struct {
	ID            int64  `json:"id"`
	IID           int64  `json:"iid"`
	ProjectID     int64  `json:"project_id"`
	BuildID       int64  `json:"build_id"`
	Status        string `json:"status"`
	PredicateKind string `json:"predicate_kind,omitempty"`
	PredicateType string `json:"predicate_type,omitempty"`
	SubjectDigest string `json:"subject_digest,omitempty"`
	DownloadURL   string `json:"download_url,omitempty"`
	CreatedAt     string `json:"created_at,omitempty"`
	UpdatedAt     string `json:"updated_at,omitempty"`
	ExpireAt      string `json:"expire_at,omitempty"`
}

Output represents a single attestation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL