Help us shape the future of Go! Take the 2026 Go Developer Survey

capabilitypublisher

package
v0.7.27 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package capabilitypublisher implements a resumable, external-signer publication flow for immutable host capability bundles.

Index

Constants

View Source
const (
	ConfigSchemaVersion    = "redevplugin.host_capability_publisher_config.v1"
	RequestSchemaVersion   = "redevplugin.host_capability_signer_request.v1"
	ResponseSchemaVersion  = "redevplugin.host_capability_signer_response.v1"
	WorkspaceSchemaVersion = "redevplugin.host_capability_publisher_workspace.v1"
	SigningUsage           = "redevplugin.host-capability-signing.manifest.v1"
)

Variables

View Source
var (
	ErrInvalidConfig       = errors.New("host capability publisher config is invalid")
	ErrInvalidRequest      = errors.New("host capability signer request is invalid")
	ErrInvalidResponse     = errors.New("host capability signer response is invalid")
	ErrWorkspaceConflict   = errors.New("host capability publisher workspace conflicts with the requested input")
	ErrWorkspaceIncomplete = errors.New("host capability publisher workspace is incomplete")
	ErrInvalidWorkspace    = errors.New("host capability publisher workspace is invalid")
)

Functions

func CanonicalSignerRequest

func CanonicalSignerRequest(request SignerRequestV1) ([]byte, error)

func CanonicalSignerResponse

func CanonicalSignerResponse(response SignerResponseV1) ([]byte, error)

func VerifyOutput

func VerifyOutput(output string) error

Types

type ConfigV1

type ConfigV1 struct {
	SchemaVersion            string                      `json:"schema_version"`
	Contract                 capabilitycontract.Contract `json:"contract"`
	ArtifactBaseRef          string                      `json:"artifact_base_ref"`
	GeneratedAt              string                      `json:"generated_at"`
	SourceCommit             string                      `json:"source_commit"`
	MinReDevPluginVersion    string                      `json:"min_redevplugin_version"`
	SignaturePolicyEpoch     string                      `json:"signature_policy_epoch"`
	SignatureRevocationEpoch string                      `json:"signature_revocation_epoch"`
	PublicKey                PublicKeyV1                 `json:"public_key"`
	Notices                  []capabilitycontract.Notice `json:"notices"`
}

type PublicKeyV1

type PublicKeyV1 struct {
	SchemaVersion string `json:"schema_version"`
	Algorithm     string `json:"algorithm"`
	KeyID         string `json:"key_id"`
	PublisherID   string `json:"publisher_id"`
	PublicKey     string `json:"public_key"`
	CreatedAt     string `json:"created_at,omitempty"`
}

type SignerRequestV1

type SignerRequestV1 struct {
	SchemaVersion         string `json:"schema_version"`
	RequestID             string `json:"request_id"`
	Usage                 string `json:"usage"`
	KeyID                 string `json:"key_id"`
	PublisherID           string `json:"publisher_id"`
	ContractID            string `json:"contract_id"`
	ContractVersion       string `json:"contract_version"`
	ManifestSHA256        string `json:"manifest_sha256"`
	SigningPreimageSHA256 string `json:"signing_preimage_sha256"`
	SigningPreimage       string `json:"signing_preimage"`
}

func DecodeSignerRequest

func DecodeSignerRequest(raw []byte) (SignerRequestV1, error)

type SignerResponseV1

type SignerResponseV1 struct {
	SchemaVersion         string `json:"schema_version"`
	RequestID             string `json:"request_id"`
	Usage                 string `json:"usage"`
	KeyID                 string `json:"key_id"`
	PublisherID           string `json:"publisher_id"`
	ContractID            string `json:"contract_id"`
	ContractVersion       string `json:"contract_version"`
	ManifestSHA256        string `json:"manifest_sha256"`
	SigningPreimageSHA256 string `json:"signing_preimage_sha256"`
	Algorithm             string `json:"algorithm"`
	Signature             string `json:"signature"`
}

func DecodeSignerResponse

func DecodeSignerResponse(raw []byte) (SignerResponseV1, error)

type StatusV1

type StatusV1 struct {
	OK              bool   `json:"ok"`
	Phase           string `json:"phase"`
	PendingRequests int    `json:"pending_requests"`
	Workspace       string `json:"workspace"`
	Output          string `json:"output,omitempty"`
}

func ApplySignature

func ApplySignature(workspace string, responseRaw []byte) (StatusV1, error)

func Finalize

func Finalize(workspace, output string) (StatusV1, error)

func Prepare

func Prepare(config ConfigV1, workspace string) (StatusV1, error)

Jump to

Keyboard shortcuts

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