Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Archive ¶
func (*Archive) BinaryChecksum ¶
BinaryChecksum retrieves checksum value of binary in archive. Returned value is base64-encoded []byte. TODO: maybe we should just return string(checksumSHA256(binary))?
type ArchiveChecksum ¶
type Base ¶
type Base struct { Overlay map[string]map[string]string `json:"overlay,omitempty"` Name string `json:"name"` Version string `json:"version"` }
Base is a minimal structure which exists in every program variations
type ChecksumCalculator ¶
type ChecksumCalculator struct {
// contains filtered or unexported fields
}
ChecksumCalculator calculates checksum by passing in data through io.Writer
func (*ChecksumCalculator) Error ¶
func (c *ChecksumCalculator) Error(expect []byte) error
Error compares the Base64 encoded checksum
type ChecksumPaths ¶ added in v0.0.3
type Config ¶
type Config struct { Base Paths *RemotePath `json:"paths"` Checksums map[string]string `json:"checksums"` Provider string `json:"provider"` }
Config is a program declaration in configuration file (default: bindl.yaml)
type CosignBundle ¶ added in v0.0.3
type CosignBundle struct { Artifact string `json:"artifact"` Certificate string `json:"certificate"` Signature string `json:"signature"` }
func (*CosignBundle) Signed ¶ added in v0.0.3
func (c *CosignBundle) Signed() bool
func (*CosignBundle) VerifySignature ¶ added in v0.0.3
func (c *CosignBundle) VerifySignature(ctx context.Context) error
type Lock ¶
type Lock struct { Base Checksums map[string]*ArchiveChecksum `json:"checksums,omitempty"` Paths *RemotePath `json:"paths"` Cosign []*CosignBundle `json:"cosign,omitempty"` }
Lock is a configuration used by lockfile to explicitly state the expected validations of each program.
func (*Lock) ArchiveName ¶
ArchiveName returns the archive name with OS and Arch interpolated if necessary, i.e. someprogram-linux-amd64.tar.gz. This reads from URL and assumes that contains the archive name.
func (*Lock) DownloadArchive ¶
func (p *Lock) DownloadArchive(ctx context.Context, d download.Downloader, goOS, goArch string) (*Archive, error)
DownloadArchive returns Archive which has the archive data in-memory, with guarantees on archive checksum. That is, if checksum fails, no data will be made available to caller.
type RemotePath ¶ added in v0.0.3
type RemotePath struct { Base string `json:"base"` Target string `json:"target"` Checksums *ChecksumPaths `json:"checksums,omitempty"` Cosign []*CosignBundle `json:"-"` // contains filtered or unexported fields }