Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrProtectionAlreadyInPlace = errors.New("controls already in place in the repository")
Functions ¶
This section is empty.
Types ¶
type Actor ¶
type Actor struct {
Login string
}
Actor abstracts a user. For now it is intended to model both entities that interact with a repository but also the user using sourcetool. At some point we may split both roles if we need to.
type AttestationStorageReader ¶
type AttestationStorageReader interface {
GetCommitVsa(context.Context, *Branch, *Commit) (*attestation.Statement, *vpb.VerificationSummary, error)
GetCommitProvenance(context.Context, *Branch, *Commit) (*attestation.Statement, *provenance.SourceProvenancePred, error)
}
AttestationStorageReader abstracts an attestation storage system where sourcetool can read VSAs and provenance attestations. For now we only have retrieval functions but this may expand to store statements as well if we need to.
type Branch ¶
type Branch struct {
Name string
Repository *Repository
}
type ControlConfiguration ¶
type ControlConfiguration string
const ( CONFIG_POLICY ControlConfiguration = "CONFIG_POLICY" CONFIG_GEN_PROVENANCE ControlConfiguration = "CONFIG_GEN_PROVENANCE" CONFIG_BRANCH_RULES ControlConfiguration = "CONFIG_BRANCH_RULES" CONFIG_TAG_RULES ControlConfiguration = "CONFIG_TAG_RULES" )
type ControlPreRemediationFn ¶
ControlPreRemediation is a function returned by the VCS backends when checking for prerequisites that the user may optionally run
type PullRequest ¶
type PullRequest struct {
Title string
Body string
Time *time.Time
Head string
Base string // main
Number int
Repo *Repository
}
PullRequest models a GitHub pull request. If we need to use this outside of the repo.PullRequestManager and other GitHub-specific code we should model a ChangeRequest or similar interface to accommodate similar constructs, such as GitLab merge requests.
type Repository ¶
func (*Repository) GetHttpURL ¶
func (r *Repository) GetHttpURL() string
func (*Repository) GetSshURL ¶
func (r *Repository) GetSshURL() string
func (*Repository) PathAsGitHubOwnerName ¶
func (r *Repository) PathAsGitHubOwnerName() (owner, name string, err error)
parseRepoPath parses the owner and repo name from the repository path
type VcsBackend ¶
type VcsBackend interface {
GetBranchControls(context.Context, *Repository, *Branch) (*slsa.ControlSetStatus, error)
GetBranchControlsAtCommit(context.Context, *Repository, *Branch, *Commit) (*slsa.ControlSetStatus, error)
GetTagControls(context.Context, *Tag) (*slsa.Controls, error)
ControlConfigurationDescr(*Branch, ControlConfiguration) string
ConfigureControls(*Repository, []*Branch, []ControlConfiguration) error
GetLatestCommit(context.Context, *Repository, *Branch) (*Commit, error)
ControlPrecheck(*Repository, []*Branch, ControlConfiguration) (bool, string, ControlPreRemediationFn, error)
}
VcsBackend abstracts a VCS or VCS hosting system that sourcetool can inspect for SLSA controls.