From 7d197ae28e5fe3bccd6dcf466e5c997a278e3878 Mon Sep 17 00:00:00 2001 From: chaosinthecrd Date: Mon, 11 Dec 2023 15:42:45 +0000 Subject: [PATCH] adding progress --- attestation/maven/maven.go | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/attestation/maven/maven.go b/attestation/maven/maven.go index 985b4ab1..ae114503 100644 --- a/attestation/maven/maven.go +++ b/attestation/maven/maven.go @@ -24,12 +24,14 @@ import ( "github.com/testifysec/go-witness/attestation" "github.com/testifysec/go-witness/cryptoutil" "github.com/testifysec/go-witness/log" + "github.com/testifysec/go-witness/registry" ) const ( - Name = "maven" - Type = "https://witness.dev/attestations/maven/v0.1" - RunType = attestation.PreMaterialRunType + Name = "maven" + Type = "https://witness.dev/attestations/maven/v0.1" + RunType = attestation.PreMaterialRunType + defaultPomPath = "pom.xml" ) // This is a hacky way to create a compile time error in case the attestor @@ -42,7 +44,22 @@ var ( func init() { attestation.RegisterAttestation(Name, Type, RunType, func() attestation.Attestor { return New() - }) + }, + registry.StringConfigOption( + "include-glob", + fmt.Sprintf("The path to the Project Object Model (POM) XML file used for task being attested (default \"%s\").", defaultPomPath), + defaultPomPath, + func(a attestation.Attestor, includeGlob string) (attestation.Attestor, error) { + prodAttestor, ok := a.(*Attestor) + if !ok { + return a, fmt.Errorf("unexpected attestor type: %T is not a product attestor", a) + } + + WithIncludeGlob(includeGlob)(prodAttestor) + return prodAttestor, nil + }, + ), + ) } type Attestor struct {