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

deployment

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidProvenance

func ValidProvenance(cfg Configuration, org string, in PreviewRequest, now time.Time) bool

func VerifySignature

func VerifySignature(key string, document any, signature string) bool

Types

type Configuration

type Configuration struct {
	NativeEnvironment     string        `json:"native_environment"`
	Environment           string        `json:"environment"`
	RepositoryID          string        `json:"repository_id"`
	Version               int64         `json:"version"`
	Enabled               bool          `json:"enabled"`
	Mode                  string        `json:"mode"`
	Workflow              Workflow      `json:"workflow"`
	RecoveryWorkflow      *Workflow     `json:"recovery_workflow,omitempty"`
	ProvenancePublicKey   string        `json:"provenance_public_key"`
	HealthPublicKey       string        `json:"health_public_key"`
	HealthChecks          []string      `json:"health_checks"`
	ObservationSeconds    int64         `json:"observation_seconds"`
	MaxEvidenceAgeSeconds int64         `json:"max_evidence_age_seconds"`
	DeadlineSeconds       int64         `json:"deadline_seconds"`
	Qualification         Qualification `json:"qualification"`
}

type Detail

type Detail struct {
	Health    *HealthReport `json:"health,omitempty"`
	Operation Operation     `json:"operation"`
	Gate      Gate          `json:"gate"`
}

type Gate

type Gate struct {
	ID                   string                `json:"id"`
	Environment          string                `json:"environment"`
	RepositoryID         string                `json:"repository_id"`
	ConnectionID         string                `json:"connection_id"`
	ConnectionVersion    int64                 `json:"connection_version"`
	ConfigurationVersion int64                 `json:"configuration_version"`
	Request              PreviewRequest        `json:"request"`
	Pipeline             forge.PipelineRequest `json:"pipeline"`
	Native               forge.DeploymentGates `json:"native"`
	Binding              policy.Binding        `json:"binding"`
	Decision             policy.Result         `json:"decision"`
	Blockers             []string              `json:"blockers"`
	ExpiresAt            time.Time             `json:"expires_at"`
}

type HealthReport

type HealthReport struct {
	OrgID                string          `json:"org_id"`
	DeploymentID         string          `json:"deployment_id"`
	Environment          string          `json:"environment"`
	ConfigurationVersion int64           `json:"configuration_version"`
	SourceSHA            string          `json:"source_sha"`
	ArtifactDigest       string          `json:"artifact_digest"`
	RunID                string          `json:"run_id"`
	RunAttempt           int64           `json:"run_attempt"`
	Revision             string          `json:"revision"`
	Healthy              bool            `json:"healthy"`
	Checks               map[string]bool `json:"checks"`
	ObservedAt           time.Time       `json:"observed_at"`
	Nonce                string          `json:"nonce"`
}

type Operation

type Operation struct {
	CancelRequested bool                    `json:"cancel_requested"`
	CancelState     string                  `json:"cancel_state"`
	FinishedAt      *time.Time              `json:"finished_at,omitempty"`
	ID              string                  `json:"id"`
	Environment     string                  `json:"environment"`
	RepositoryID    string                  `json:"repository_id"`
	GateID          string                  `json:"gate_id"`
	State           string                  `json:"state"`
	Reason          string                  `json:"reason"`
	Version         int64                   `json:"version"`
	RequestedBy     string                  `json:"requested_by"`
	Native          *forge.DeploymentStatus `json:"native,omitempty"`
	RecoveryOf      string                  `json:"recovery_of,omitempty"`
	CreatedAt       time.Time               `json:"created_at"`
	UpdatedAt       time.Time               `json:"updated_at"`
}

type PreviewRequest

type PreviewRequest struct {
	ChangeID            string           `json:"change_id"`
	SourceSHA           string           `json:"source_sha"`
	ArtifactDigest      string           `json:"artifact_digest"`
	Provenance          SignedProvenance `json:"provenance"`
	RecoveryOf          string           `json:"recovery_of,omitempty"`
	RestoreDeploymentID string           `json:"restore_deployment_id,omitempty"`
}

type Provenance

type Provenance struct {
	OrgID          string    `json:"org_id"`
	RepositoryID   string    `json:"repository_id"`
	SourceSHA      string    `json:"source_sha"`
	ArtifactDigest string    `json:"artifact_digest"`
	BuildID        string    `json:"build_id"`
	IssuedAt       time.Time `json:"issued_at"`
	ExpiresAt      time.Time `json:"expires_at"`
}

type Qualification

type Qualification struct {
	Provider                 string    `json:"provider"`
	ServerVersion            string    `json:"server_version"`
	ConnectionVersion        int64     `json:"connection_version"`
	EvidenceReference        string    `json:"evidence_reference"`
	EvidenceSHA256           string    `json:"evidence_sha256"`
	VerifiedAt               time.Time `json:"verified_at"`
	ExpiresAt                time.Time `json:"expires_at"`
	PinnedInputs             bool      `json:"pinned_inputs"`
	NativeEnforcement        bool      `json:"native_enforcement"`
	EnvironmentSerialization bool      `json:"environment_serialization"`
	NoBypass                 bool      `json:"no_bypass"`
}

type Service

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

func New

func New(db *store.Store, identity *auth.Service, connections *connections.Service, policies *policy.Service, providers providers.Client) *Service

func (*Service) Cancel

func (s *Service) Cancel(ctx context.Context, session auth.Session, org, id string, expected int64, request string) (Operation, error)

func (*Service) Configurations

func (s *Service) Configurations(ctx context.Context, session auth.Session, org string) ([]Configuration, error)

func (*Service) Continue

func (s *Service) Continue(ctx context.Context, session auth.Session, org, id, request string) (Operation, error)

func (*Service) Get

func (s *Service) Get(ctx context.Context, session auth.Session, org, id string) (Detail, error)

func (*Service) List

func (s *Service) List(ctx context.Context, session auth.Session, org, repo, env, cursor string, limit int) (domain.Page[Operation], error)

func (*Service) Observe

func (s *Service) Observe(ctx context.Context, org, id string) (Operation, error)

func (*Service) ObserveAs

func (s *Service) ObserveAs(ctx context.Context, session auth.Session, org, id string) (Operation, error)

func (*Service) Preview

func (s *Service) Preview(ctx context.Context, session auth.Session, org, environment string, in PreviewRequest, request string) (Gate, error)

func (*Service) PutConfiguration

func (s *Service) PutConfiguration(ctx context.Context, session auth.Session, org string, in Configuration, expected int64, request string) (Configuration, error)

func (*Service) ReceiveHealth

func (s *Service) ReceiveHealth(ctx context.Context, org, id string, in HealthReport, signature string) error

func (*Service) RegisterGateAuthority

func (s *Service) RegisterGateAuthority(check func(context.Context, pgx.Tx, string, string) error)

func (*Service) Request

func (s *Service) Request(ctx context.Context, session auth.Session, org, gateID, key, request string) (Operation, error)

func (*Service) Run

func (s *Service) Run(ctx context.Context) error

func (*Service) Track

func (s *Service) Track(ctx context.Context, session auth.Session, org, environment string, in TrackRequest, request string) (Operation, error)

func (*Service) Workflows

func (s *Service) Workflows(ctx context.Context, session auth.Session, org, repo string) ([]forge.Workflow, error)

type SignedProvenance

type SignedProvenance struct {
	Document  Provenance `json:"document"`
	Signature string     `json:"signature"`
}

type TrackRequest

type TrackRequest struct {
	PreviewRequest
	RunID          string `json:"run_id"`
	IdempotencyKey string `json:"idempotency_key"`
}

type Workflow

type Workflow struct {
	ID           string            `json:"id"`
	Path         string            `json:"path"`
	Ref          string            `json:"ref"`
	SHA          string            `json:"sha"`
	ConfigSHA256 string            `json:"config_sha256"`
	Inputs       map[string]string `json:"inputs"`
}

Jump to

Keyboard shortcuts

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