model

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const SchemaVersion = "1.3"
View Source
const Sha256DigestType = "sha256"

Sha256DigestType is the digest type used for subjects identified by the sha256 of their content.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttachmentRef added in v0.9.0

type AttachmentRef struct {
	Name         string  `json:"name"`
	Sha256       string  `json:"sha256"`
	Type         *string `json:"type,omitempty"`
	DownloadPath string  `json:"downloadPath"`
}

type AttachmentVerification added in v0.9.0

type AttachmentVerification struct {
	Name               string             `json:"name"`
	ExpectedSha256     string             `json:"expectedSha256,omitempty"`
	ActualSha256       string             `json:"actualSha256,omitempty"`
	DownloadPath       string             `json:"downloadPath,omitempty"`
	VerificationStatus VerificationStatus `json:"verificationStatus"`
	FailureReason      string             `json:"failureReason,omitempty"`
}

type CreateResponse

type CreateResponse struct {
	Repository        string                     `json:"repository"`
	Path              string                     `json:"path"`
	Name              string                     `json:"name"`
	Uri               string                     `json:"uri"`
	Sha256            string                     `json:"sha256"`
	PredicateCategory string                     `json:"predicate_category"`
	PredicateType     string                     `json:"predicate_type"`
	PredicateSlug     string                     `json:"predicate_slug"`
	CreatedAt         string                     `json:"created_at"`
	CreatedBy         string                     `json:"created_by"`
	Verified          bool                       `json:"verified"`
	ProviderId        string                     `json:"provider_id"`
	Attachments       []CreateResponseAttachment `json:"attachments,omitempty"`
}

type CreateResponseAttachment added in v0.9.4

type CreateResponseAttachment struct {
	Name         string `json:"name,omitempty"`
	Sha256       string `json:"sha256,omitempty"`
	Type         string `json:"type,omitempty"`
	DownloadPath string `json:"download_path,omitempty"`
}

CreateResponseAttachment mirrors the evidence service AttachmentView schema.

type EntitySubject added in v0.10.0

type EntitySubject struct {
	EntityType     string
	EntityID       string
	EntityRepo     string
	ProjectKey     string
	ApplicationKey string
}

EntitySubject holds the identity and Artifactory scope for an entity evidence subject. Exactly one of EntityRepo, ProjectKey, and ApplicationKey may be set (or none).

type Evidence

type Evidence struct {
	SearchEvidence SearchEvidence `json:"searchEvidence"`
}

type EvidenceData

type EvidenceData struct {
	Evidence Evidence `json:"evidence"`
}

type EvidenceMetadata

type EvidenceMetadata struct {
	DownloadPath      string `json:"downloadPath"`
	Name              string `json:"name"`
	Sha256            string `json:"sha256"`
	RepositoryKey     string `json:"repositoryKey"`
	Path              string `json:"path"`
	PredicateType     string `json:"predicateType"`
	PredicateCategory string `json:"predicateCategory"`
	PredicateSlug     string `json:"predicateSlug"`
	Predicate         string `json:"predicate"`
	CreatedAt         string `json:"createdAt"`
	CreatedBy         string `json:"createdBy"`
	// Verified is Evidence GraphQL Evidence.verified (DB evidence_verified after ingest).
	Verified    bool            `json:"verified"`
	Subject     EvidenceSubject `json:"subject"`
	ProviderId  string          `json:"providerId"`
	SigningKey  SingingKey      `json:"signingKey"`
	Attachments []AttachmentRef `json:"attachments,omitempty"`
	// AttachmentsUnavailable indicates metadata was loaded via GraphQL fallback
	// where the attachments field is not supported by server schema.
	AttachmentsUnavailable bool `json:"-"`
}

type EvidenceSubject

type EvidenceSubject struct {
	Sha256        string `json:"sha256"`
	RepositoryKey string `json:"repositoryKey"`
	Path          string `json:"path"`
	Name          string `json:"name"`
}

type EvidenceVerification

type EvidenceVerification struct {
	MediaType       MediaType `json:"mediaType"`
	DownloadPath    string    `json:"downloadPath"`
	SubjectChecksum string    `json:"evidenceSubjectSha256,omitempty"`
	// SignedSubjectDigest is the digest map from the signed in-toto statement.
	// Keys are digest types and values are digest values:
	//   - content subjects: {"sha256": "<checksum>"}
	//   - entity subjects:  {"<entityType>": "<entityId>"} (e.g. {"gitCommit": "abc123"})
	// On success it holds the matched digest. On failure it retains the collapsed
	// first-wins map for older clients; prefer AvailableSubjectDigests for the
	// complete, non-lossy list.
	SignedSubjectDigest map[string]string `json:"signedSubjectDigest,omitempty"`
	// AvailableSubjectDigests lists every subject digest found in the signed statement when
	// subject-digest verification fails. Preserving the per-subject maps avoids collapsing
	// colliding digest types across subjects.
	AvailableSubjectDigests []map[string]string        `json:"availableSubjectDigests,omitempty"`
	PredicateType           string                     `json:"predicateType"`
	CreatedBy               string                     `json:"createdBy"`
	CreatedAt               string                     `json:"createdAt"`
	VerificationResult      EvidenceVerificationResult `json:"verificationResult"`
	AttachmentsVerification []AttachmentVerification   `json:"attachmentsVerification,omitempty"`
	DsseEnvelope            *dsse.Envelope             `json:"dsseEnvelope,omitempty"`
	SigstoreBundle          *bundle.Bundle             `json:"sigstoreBundle,omitempty"`
}

type EvidenceVerificationResult

type EvidenceVerificationResult struct {
	Sha256VerificationStatus         VerificationStatus         `json:"sha256VerificationStatus,omitempty"`
	SubjectDigestVerificationStatus  VerificationStatus         `json:"subjectDigestVerificationStatus,omitempty"`
	SignaturesVerificationStatus     VerificationStatus         `json:"signaturesVerificationStatus,omitempty"`
	SigstoreBundleVerificationStatus VerificationStatus         `json:"sigstoreBundleVerificationStatus,omitempty"`
	SignaturesVerificationNote       string                     `json:"signaturesVerificationNote,omitempty"`
	KeySource                        string                     `json:"keySource,omitempty"`
	KeyFingerprint                   string                     `json:"keyFingerprint,omitempty"`
	SigstoreBundleVerificationResult *verify.VerificationResult `json:"sigstoreBundleVerificationResult,omitempty"`
	AttachmentsVerificationStatus    VerificationStatus         `json:"attachmentsVerificationStatus,omitempty"`
	FailureReason                    string                     `json:"failureReason,omitempty"`
}

type GitLogEntry

type GitLogEntry struct {
	Commit            string `json:"commit,omitempty"`
	AbbreviatedCommit string `json:"abbreviated_commit,omitempty"`
	Tree              string `json:"tree,omitempty"`
	AbbreviatedTree   string `json:"abbreviated_tree,omitempty"`
	Parent            string `json:"parent,omitempty"`
	AbbreviatedParent string `json:"abbreviated_parent,omitempty"`
	Subject           string `json:"subject,omitempty"`
	SanitizedSubject  string `json:"sanitized_subject_line,omitempty"`
	Author            struct {
		Name  string `json:"name,omitempty"`
		Email string `json:"email,omitempty"`
		Date  string `json:"date,omitempty"`
	} `json:"author,omitempty"`
	Commiter struct {
		Name  string `json:"name,omitempty"`
		Email string `json:"email,omitempty"`
		Date  string `json:"date,omitempty"`
	} `json:"commiter,omitempty"`
	PRreviewer []vcsclient.PullRequestReviewDetails `json:"pr_reviewer,omitempty"`
}

type GitLogEntryView

type GitLogEntryView struct {
	Data     []GitLogEntry     `json:"data"`
	Link     string            `json:"link"`
	Artifact entities.Artifact `json:"artifact"`
}

type MediaType

type MediaType string
const (
	SigstoreBundle MediaType = "sigstore.bundle"
	SimpleDSSE     MediaType = "evidence.dsse"
)

type MetadataResponse

type MetadataResponse struct {
	Data VersionsData `json:"data"`
}

type Repo

type Repo struct {
	Name         string `json:"name"`
	LeadFilePath string `json:"leadFilePath"`
}

type ResponseSearchEvidence

type ResponseSearchEvidence struct {
	Data EvidenceData `json:"data"`
}

type SearchEvidence

type SearchEvidence struct {
	Edges []SearchEvidenceEdge `json:"edges"`
}

type SearchEvidenceEdge

type SearchEvidenceEdge struct {
	Node EvidenceMetadata `json:"node"`
}

type SingingKey

type SingingKey struct {
	Alias     string `json:"alias"`
	PublicKey string `json:"publicKey"`
}

type Subject

type Subject struct {
	Path       string `json:"path"`
	Sha256     string `json:"sha256,omitempty"`
	EntityType string `json:"entityType,omitempty"`
	EntityId   string `json:"entityId,omitempty"`
}

type SubjectDigest added in v0.10.0

type SubjectDigest struct {
	Type  string
	Value string
}

SubjectDigest is the digest entry a signed in-toto statement is expected to carry for the verified subject. Content-based subjects use Sha256DigestType with the content checksum as the value. Entity subjects use the entity type as the digest type and the entity id as the value (for example Type="gitCommit", Value="abc123").

func (SubjectDigest) IsSha256 added in v0.10.0

func (s SubjectDigest) IsSha256() bool

IsSha256 reports whether the subject is identified by the sha256 of its content.

type VerificationResponse

type VerificationResponse struct {
	// Update the schemaVersion value when this structure is updated.
	SchemaVersion             string                  `json:"schemaVersion"`
	Subject                   Subject                 `json:"subject"`
	EvidenceVerifications     *[]EvidenceVerification `json:"evidenceVerifications"`
	OverallVerificationStatus VerificationStatus      `json:"overallVerificationStatus"`
}

type VerificationStatus

type VerificationStatus string
const (
	Success VerificationStatus = "success"
	Failed  VerificationStatus = "failed"
)

type VersionEdges

type VersionEdges struct {
	Node VersionNode `json:"node"`
}

type VersionNode

type VersionNode struct {
	Repos []Repo `json:"repos"`
}

type Versions

type Versions struct {
	Edges []VersionEdges `json:"edges"`
}

type VersionsData

type VersionsData struct {
	Versions Versions `json:"versions"`
}

Jump to

Keyboard shortcuts

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