client

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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureFeatureSupported

func EnsureFeatureSupported(serverDetails *config.ServerDetails, feature evidenceutils.EvidenceFeature) error

EnsureFeatureSupported fails when the Evidence service is a release older than the minimum that supports feature. Non-release / development version strings are allowed through so local and snapshot builds are not blocked.

Types

type CreateEntityEvidenceRequest

type CreateEntityEvidenceRequest struct {
	EntityType     string
	EntityID       string
	EntityRepo     string
	ProjectKey     string
	ApplicationKey string
	ProviderID     string
}

CreateEntityEvidenceRequest identifies the entity subject and optional Artifactory scope / provider for a create call. At most one of EntityRepo, ProjectKey, and ApplicationKey may be set.

type EvidenceClient

type EvidenceClient struct {
	// contains filtered or unexported fields
}

EvidenceClient talks to Evidence REST APIs that are not yet available in jfrog-client-go.

func NewEvidenceClient

func NewEvidenceClient(serverDetails *config.ServerDetails) (*EvidenceClient, error)

NewEvidenceClient builds a client using the same Evidence URL/auth as CreateEvidenceServiceManager.

func (*EvidenceClient) CreateEntityEvidence

func (c *EvidenceClient) CreateEntityEvidence(request CreateEntityEvidenceRequest, payload []byte) ([]byte, error)

CreateEntityEvidence POSTs a signed DSSE envelope or Sigstore bundle to /evidence/api/v1/entity/{type}/{id}.

func (*EvidenceClient) GetVersion

func (c *EvidenceClient) GetVersion() (string, error)

GetVersion returns the Evidence service version from GET /api/v1/system/version.

func (*EvidenceClient) PrepareEvidence

func (c *EvidenceClient) PrepareEvidence(request PrepareEvidenceRequest, includePAE bool) (*PrepareEvidenceResponse, error)

PrepareEvidence asks Evidence to generate an in-toto statement for external signing.

func (*EvidenceClient) UploadPreparedSignedEvidence

func (c *EvidenceClient) UploadPreparedSignedEvidence(postURL string, signedEnvelope []byte) ([]byte, error)

UploadPreparedSignedEvidence uploads a signed DSSE envelope to the root-relative post URL returned by PrepareEvidence.

type PrepareEvidenceAttachment

type PrepareEvidenceAttachment struct {
	Repository string `json:"repository"`
	Path       string `json:"path"`
	SHA256     string `json:"sha256,omitempty"`
}

PrepareEvidenceAttachment identifies an attachment in Artifactory. SHA256 is optional in a prepare request and is resolved by Evidence.

type PrepareEvidenceRequest

type PrepareEvidenceRequest struct {
	Predicate      json.RawMessage             `json:"predicate"`
	PredicateType  string                      `json:"predicate_type"`
	Markdown       string                      `json:"markdown,omitempty"`
	ProviderID     string                      `json:"provider_id,omitempty"`
	Subject        PrepareEvidenceSubject      `json:"subject"`
	EntityRepo     string                      `json:"entity_repo,omitempty"`
	ProjectKey     string                      `json:"project_key,omitempty"`
	ApplicationKey string                      `json:"application_key,omitempty"`
	Attachments    []PrepareEvidenceAttachment `json:"attachments,omitempty"`
}

PrepareEvidenceRequest contains the data used by Evidence to generate an in-toto statement for signing. For entity subjects, at most one of EntityRepo, ProjectKey, and ApplicationKey may be set.

type PrepareEvidenceResponse

type PrepareEvidenceResponse struct {
	PostURL                   string                      `json:"post_url"`
	DSSEPayload               string                      `json:"dsse_payload"`
	DSSEPayloadType           string                      `json:"dsse_payload_type"`
	PreAuthenticationEncoding string                      `json:"pre_authentication_encoding,omitempty"`
	Attachments               []PrepareEvidenceAttachment `json:"attachments,omitempty"`
}

type PrepareEvidenceSubject

type PrepareEvidenceSubject struct {
	SubjectType   SubjectType `json:"subject_type"`
	SubjectSHA256 string      `json:"subject_sha256,omitempty"`

	RepoPath string `json:"repo_path,omitempty"`

	EntityType string `json:"entity_type,omitempty"`
	EntityID   string `json:"entity_id,omitempty"`

	BuildName      string `json:"build_name,omitempty"`
	BuildNumber    string `json:"build_number,omitempty"`
	BuildTimestamp string `json:"build_timestamp,omitempty"`

	ReleaseBundleName    string `json:"release_bundle_name,omitempty"`
	ReleaseBundleVersion string `json:"release_bundle_version,omitempty"`

	ApplicationKey     string `json:"application_key,omitempty"`
	ApplicationVersion string `json:"application_version,omitempty"`

	PackageRepo    string `json:"package_repo,omitempty"`
	PackageName    string `json:"package_name,omitempty"`
	PackageVersion string `json:"package_version,omitempty"`
}

PrepareEvidenceSubject identifies the subject for which Evidence prepares the statement.

type SubjectType

type SubjectType string
const (
	SubjectTypeArtifact           SubjectType = "artifact"
	SubjectTypeBuild              SubjectType = "build"
	SubjectTypePackage            SubjectType = "package"
	SubjectTypeReleaseBundle      SubjectType = "release_bundle"
	SubjectTypeApplicationVersion SubjectType = "application_version"
	SubjectTypeEntity             SubjectType = "entity"
)

Jump to

Keyboard shortcuts

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