Skip to content

Commit abd4327

Browse files
committed
Move defaultRoots to live in sigstore pacakge
Signed-off-by: Adolfo García Veytia (Puerco) <[email protected]>
1 parent ae37ebf commit abd4327

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

options/signer.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ package options
66
import (
77
"errors"
88

9+
"github.com/carabiner-dev/signer/sigstore"
910
"github.com/sigstore/sigstore/pkg/oauthflow"
1011
)
1112

1213
var DefaultSigner = Signer{
13-
SigstoreRootsData: DefaultRoots, // Embedded data from the rootsfile
14+
SigstoreRootsData: sigstore.DefaultRoots, // Embedded data from the rootsfile
1415
}
1516

1617
// Signer

options/sigstore_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
// TestEnsureDefaultSigstore checks that the default sigstore
1616
// options match the first instance in the roots file.
1717
func TestEnsureDefaultSigstore(t *testing.T) {
18-
conf, err := sigstore.ParseRoots(DefaultRoots)
18+
conf, err := sigstore.ParseRoots(sigstore.DefaultRoots)
1919
require.NoError(t, err)
2020

2121
moded := DefaultSigstore
@@ -37,13 +37,13 @@ func TestDefaultRoots(t *testing.T) {
3737
}{
3838
{"top-level-file", func(t *testing.T) *sigstore.SigstoreRoots {
3939
t.Helper()
40-
roots, err := sigstore.ParseRootsFile("sigstore-roots.json")
40+
roots, err := sigstore.ParseRootsFile("../sigstore-roots.json")
4141
require.NoError(t, err)
4242
return roots
4343
}},
4444
{"options-embed", func(t *testing.T) *sigstore.SigstoreRoots {
4545
t.Helper()
46-
roots, err := sigstore.ParseRoots(DefaultRoots)
46+
roots, err := sigstore.ParseRoots(sigstore.DefaultRoots)
4747
require.NoError(t, err)
4848
return roots
4949
}},

options/verifier.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ package options
55

66
import (
77
"crypto"
8-
_ "embed"
9-
)
108

11-
//go:embed sigstore-roots.json
12-
var DefaultRoots []byte
9+
"github.com/carabiner-dev/signer/sigstore"
10+
)
1311

1412
type VerifierOptFunc func(*Verifier)
1513

@@ -37,7 +35,7 @@ type Verifier struct {
3735
// DefaultVerifier default options to configure the verifier
3836
var DefaultVerifier = Verifier{
3937
Verification: DefaultVerification,
40-
SigstoreRootsData: DefaultRoots, // Embedded data from the file
38+
SigstoreRootsData: sigstore.DefaultRoots, // Embedded data from the file
4139
}
4240

4341
// WithSigstoreRootsPath sets the path to the sigstore roots configuration file

sigstore-roots.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
options/sigstore-roots.json
1+
sigstore/sigstore-roots.json

sigstore/root.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ import (
1010
"os"
1111
)
1212

13+
//go:embed sigstore-roots.json
14+
var DefaultRoots []byte
15+
1316
//go:embed roots
1417
var rootFiles embed.FS
1518

0 commit comments

Comments
 (0)