sign

package
v0.0.0-...-bf50695 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package sign provides implementations for servers which can sign Go release artifacts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildType

type BuildType int

BuildType is the type of build the signing request is for.

const (
	BuildUnspecified BuildType = iota

	BuildMacOS
	BuildWindows
	BuildGPG

	BuildMacOSConstructInstallerOnly
	BuildWindowsConstructInstallerOnly

	BuildMacOSBinary
	BuildWindowsBinary
)

func (BuildType) String

func (bt BuildType) String() string

type Service

type Service interface {
	// SignArtifact creates a request to sign a release artifact.
	// The object URI must be URIs for file(s) on the service private GCS.
	SignArtifact(ctx context.Context, bt BuildType, objectURI []string) (jobID string, _ error)
	// ArtifactSigningStatus retrieves the status of an existing signing request,
	// or an error indicating that the status couldn't be determined.
	// If the status is completed, objectURI will be populated with the URIs for signed files in GCS.
	ArtifactSigningStatus(ctx context.Context, jobID string) (_ Status, description string, objectURI []string, _ error)
	// CancelSigning marks a previous signing request as no longer needed,
	// possibly allowing resources to be freed sooner than otherwise.
	CancelSigning(ctx context.Context, jobID string) error
}

Service is an interface for a release artifact signing service.

Each call blocks until either the request has been acknowledged or the passed in context has been canceled. Setting a timeout on the context is recommended.

type SigningServer

type SigningServer struct {
	protos.UnimplementedReleaseServiceServer
	// contains filtered or unexported fields
}

SigningServer is a GRPC signing server used to send signing requests and signing status requests to a client.

func NewServer

func NewServer() *SigningServer

NewServer creates a GRPC signing server used to send signing requests and signing status requests to a client.

func (*SigningServer) ArtifactSigningStatus

func (rs *SigningServer) ArtifactSigningStatus(ctx context.Context, jobID string) (_ Status, desc string, objectURI []string, _ error)

ArtifactSigningStatus implements Service.

func (*SigningServer) CancelSigning

func (rs *SigningServer) CancelSigning(ctx context.Context, jobID string) error

CancelSigning implements Service.

func (*SigningServer) SignArtifact

func (rs *SigningServer) SignArtifact(ctx context.Context, bt BuildType, objectURI []string) (jobID string, _ error)

SignArtifact implements Service.

func (*SigningServer) UpdateSigningStatus

func (rs *SigningServer) UpdateSigningStatus(stream protos.ReleaseService_UpdateSigningStatusServer) error

UpdateSigningStatus uses a bidirectional streaming connection to send signing requests to the client and receive status updates on signing requests. There is no specific order which the requests or responses need to occur in. The connection returns an error once the context is canceled or an error is encountered.

type Status

type Status int

Status of the signing request.

const (
	StatusUnknown Status = iota
	StatusRunning
	StatusFailed
	StatusCompleted
	StatusNotFound
)

func (Status) String

func (bs Status) String() string

String is the string representation for the signing request status.

Jump to

Keyboard shortcuts

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