drop table view

Signed-off-by: Meredith Lancaster <malancas@github.com>
This commit is contained in:
Meredith Lancaster 2024-11-26 13:36:51 -07:00
parent c9be8ce7b9
commit a326f5cb18
3 changed files with 1 additions and 43 deletions

View file

@ -29,10 +29,6 @@ func NewTestHandler() *Handler {
return NewHandler(testIO)
}
func (h *Handler) DebugEnabled() bool {
return h.debugEnabled
}
// Printf writes the formatted arguments to the stderr writer.
func (h *Handler) Printf(f string, v ...interface{}) (int, error) {
if !h.IO.IsStdoutTTY() {

View file

@ -82,30 +82,3 @@ The following policy criteria will be enforced against all attestations:
return template
}
func (c EnforcementCriteria) BuildPolicyInformationForTable() [][]string {
predicateInfo := []string{"Predicate type", c.PredicateType}
issuerInfo := []string{"Issuer", c.Certificate.Issuer}
ownerURIInfo := []string{"SourceRepositoryOwnerURI", c.Certificate.SourceRepositoryOwnerURI}
info := [][]string{predicateInfo, issuerInfo, ownerURIInfo}
if c.Certificate.SourceRepositoryURI != "" {
sourceRepoURIInfo := []string{"SourceRepositoryURI", c.Certificate.SourceRepositoryURI}
info = append(info, sourceRepoURIInfo)
}
if c.Certificate.RunnerEnvironment == GitHubRunner {
runnerInfo := []string{"RunnerEnvironment", c.Certificate.RunnerEnvironment}
info = append(info, runnerInfo)
}
if c.SAN != "" {
sanInfo := []string{"SAN", c.SAN}
info = append(info, sanInfo)
} else if c.SANRegex != "" {
sanRegexInfo := []string{"SANRegex", c.SANRegex}
info = append(info, sanRegexInfo)
}
return info
}

View file

@ -243,18 +243,7 @@ func runVerify(opts *Options) error {
attestations = filteredAttestations
// print information about the policy that will be enforced against attestations
if opts.Logger.DebugEnabled() {
policyTableInfo := ec.BuildPolicyInformationForTable()
headers := []string{"attribute", "must match"}
opts.Logger.Println("")
if err = opts.Logger.PrintTable(headers, policyTableInfo); err != nil {
opts.Logger.Println(opts.Logger.ColorScheme.Red("failed to print policy information to table"))
return err
}
opts.Logger.Println("")
} else {
opts.Logger.Println(ec.BuildPolicyInformation())
}
opts.Logger.Println(ec.BuildPolicyInformation())
verified, errMsg, err := verifyAttestations(*artifact, attestations, opts.SigstoreVerifier, ec)
if err != nil {