Documentation
¶
Index ¶
- Variables
- type ConfigFn
- type Tool
- func (t *Tool) CheckPolicyRepoFork() (bool, error)
- func (t *Tool) ConfigureControls(repo *models.Repository, branches []*models.Branch, ...) error
- func (t *Tool) ControlConfigurationDescr(branch *models.Branch, config models.ControlConfiguration) string
- func (t *Tool) ControlPrecheck(r *models.Repository, branches []*models.Branch, ...) (ok bool, remediationMessage string, remediateFn models.ControlPreRemediationFn, ...)
- func (t *Tool) CreateBranchPolicy(ctx context.Context, r *models.Repository, branches []*models.Branch) (*policy.RepoPolicy, error)
- func (t *Tool) CreatePolicyRepoFork(ctx context.Context) error
- func (t *Tool) CreateRepositoryPolicy(ctx context.Context, r *models.Repository, branches []*models.Branch) (*policy.RepoPolicy, *models.PullRequest, error)
- func (t *Tool) FindPolicyPR(repo *models.Repository) (*models.PullRequest, error)
- func (t *Tool) GetBranchControls(r *models.Repository, branch *models.Branch) (*slsa.ControlSetStatus, error)
- func (t *Tool) GetRepositoryPolicy(ctx context.Context, r *models.Repository) (*policy.RepoPolicy, error)
- func (t *Tool) OnboardRepository(repo *models.Repository, branches []*models.Branch) error
Constants ¶
This section is empty.
Variables ¶
var ControlConfigurations = []models.ControlConfiguration{ models.CONFIG_POLICY, models.CONFIG_GEN_PROVENANCE, models.CONFIG_BRANCH_RULES, models.CONFIG_TAG_RULES, }
Functions ¶
This section is empty.
Types ¶
type ConfigFn ¶
func WithAuthenticator ¶
func WithAuthenticator(a *auth.Authenticator) ConfigFn
func WithCreatePolicyPR ¶
func WithEnforce ¶
func WithPolicyRepo ¶
func WithUserForkOrg ¶
type Tool ¶
type Tool struct {
Authenticator *auth.Authenticator
Options options.Options
// contains filtered or unexported fields
}
Tool is the main object intended to expose sourcetool's functionality as a public API. Some of the logic is still implemented on the CLI commands but we want to slowly move it to public function under this struct.
func (*Tool) CheckPolicyRepoFork ¶
CheckPolicyRepoFork checks that the logged in user has a fork of the configured policy repo.
func (*Tool) ConfigureControls ¶
func (t *Tool) ConfigureControls(repo *models.Repository, branches []*models.Branch, configs []models.ControlConfiguration) error
ConfigureControls sets up a control in the repo
func (*Tool) ControlConfigurationDescr ¶
func (t *Tool) ControlConfigurationDescr(branch *models.Branch, config models.ControlConfiguration) string
ControlConfigurationDescr returns a description of the controls
func (*Tool) ControlPrecheck ¶
func (t *Tool) ControlPrecheck( r *models.Repository, branches []*models.Branch, config models.ControlConfiguration, ) (ok bool, remediationMessage string, remediateFn models.ControlPreRemediationFn, err error)
ControlPrecheck performs a prerequisite check before enabling a contrlol Backend may optionally return a remediation function to correct the prerequisite which the CLI can before attempting to enable the control.
func (*Tool) CreateBranchPolicy ¶
func (t *Tool) CreateBranchPolicy(ctx context.Context, r *models.Repository, branches []*models.Branch) (*policy.RepoPolicy, error)
CreateBranchPolicy creates a repository policy
func (*Tool) CreatePolicyRepoFork ¶
CreatePolicyRepoFork creates a fork of the policy repository in the user's GitHub org
func (*Tool) CreateRepositoryPolicy ¶
func (t *Tool) CreateRepositoryPolicy(ctx context.Context, r *models.Repository, branches []*models.Branch) (*policy.RepoPolicy, *models.PullRequest, error)
CreateRepositoryPolicy creates a policy for a repository
func (*Tool) FindPolicyPR ¶
func (t *Tool) FindPolicyPR(repo *models.Repository) (*models.PullRequest, error)
func (*Tool) GetBranchControls ¶
func (t *Tool) GetBranchControls(r *models.Repository, branch *models.Branch) (*slsa.ControlSetStatus, error)
GetRepoControls returns the controls that are enabled in a repository branch.
func (*Tool) GetRepositoryPolicy ¶
func (t *Tool) GetRepositoryPolicy(ctx context.Context, r *models.Repository) (*policy.RepoPolicy, error)
GetRepositoryPolicy retrieves the policy of repo from the community
func (*Tool) OnboardRepository ¶
OnboardRepository configures a repository to set up the required controls to meet SLSA Source L3.
Directories
¶
| Path | Synopsis |
|---|---|
|
backends
|
|
|
attestation/notes
Package notes implements an attestation storage backend that reads from git commit notes
|
Package notes implements an attestation storage backend that reads from git commit notes |
|
modelsfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
|
Code generated by counterfeiter.
|
Code generated by counterfeiter. |