Documentation ¶
Index ¶
- Constants
- func GitExists() bool
- func GitGetBinHash(ctx *attestation.AttestationContext) (cryptoutil.DigestSet, error)
- func GitGetBinPath() (string, error)
- func GitGetStatus(workDir string) (map[string]Status, error)
- func GoGitGetStatus(repo *git.Repository) (map[string]Status, error)
- type Attestor
- func (a *Attestor) Attest(ctx *attestation.AttestationContext) error
- func (a *Attestor) BackRefs() map[string]cryptoutil.DigestSet
- func (a *Attestor) Data() *Attestor
- func (a *Attestor) Name() string
- func (a *Attestor) RunType() attestation.RunType
- func (a *Attestor) Schema() *jsonschema.Schema
- func (a *Attestor) Subjects() map[string]cryptoutil.DigestSet
- func (a *Attestor) Type() string
- type GitAttestor
- type Status
- type Tag
Constants ¶
View Source
const ( Name = "git" Type = "https://witness.dev/attestations/git/v0.1" RunType = attestation.PreMaterialRunType )
Variables ¶
This section is empty.
Functions ¶
func GitExists ¶ added in v0.7.0
func GitExists() bool
GitExists checks if the git binary is available. This can be used to fall back to go-git implementation.
func GitGetBinHash ¶ added in v0.7.0
func GitGetBinHash(ctx *attestation.AttestationContext) (cryptoutil.DigestSet, error)
GitGetBinHash retrieves a sha256 hash of the git binary that is located on the system. The path is determined based on exec.LookPath().
func GitGetBinPath ¶ added in v0.7.0
GitGetBinPath retrieves the path to the git binary that is used by the attestor.
func GitGetStatus ¶ added in v0.7.0
GitGetStatus retrieves the status of staging and worktree from the git status --porcelain output
func GoGitGetStatus ¶ added in v0.7.0
Types ¶
type Attestor ¶
type Attestor struct { GitTool string `json:"gittool"` GitBinPath string `json:"gitbinpath,omitempty"` GitBinHash cryptoutil.DigestSet `json:"gitbinhash,omitempty"` CommitHash string `json:"commithash"` Author string `json:"author"` AuthorEmail string `json:"authoremail"` CommitterName string `json:"committername"` CommitterEmail string `json:"committeremail"` CommitDate string `json:"commitdate"` CommitMessage string `json:"commitmessage"` Status map[string]Status `json:"status,omitempty"` CommitDigest cryptoutil.DigestSet `json:"commitdigest,omitempty"` Signature string `json:"signature,omitempty"` ParentHashes []string `json:"parenthashes,omitempty"` TreeHash string `json:"treehash,omitempty"` Refs []string `json:"refs,omitempty"` Remotes []string `json:"remotes,omitempty"` Tags []Tag `json:"tags,omitempty"` RefNameShort string `json:"branch,omitempty"` }
func (*Attestor) Attest ¶
func (a *Attestor) Attest(ctx *attestation.AttestationContext) error
func (*Attestor) RunType ¶
func (a *Attestor) RunType() attestation.RunType
func (*Attestor) Schema ¶ added in v0.4.0
func (a *Attestor) Schema() *jsonschema.Schema
type GitAttestor ¶ added in v0.4.0
type GitAttestor interface { // Attestor Name() string Type() string RunType() attestation.RunType Attest(ctx *attestation.AttestationContext) error Data() *Attestor // Subjecter Subjects() map[string]cryptoutil.DigestSet // Backreffer BackRefs() map[string]cryptoutil.DigestSet }
Click to show internal directories.
Click to hide internal directories.