Skip to content

Commit 0178963

Browse files
committed
refactor: extract pinned placeholder strings to constants
1 parent d707a2c commit 0178963

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

client/client.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ import (
1414
"github.com/tinfoilsh/verifier/util"
1515
)
1616

17+
const (
18+
pinnedNoRepo = "pinned_no_repo"
19+
pinnedNoDigest = "pinned_no_digest"
20+
)
21+
1722
//go:embed trusted_root.json
1823
var embeddedTrustedRoot []byte
1924

@@ -73,7 +78,7 @@ func NewSecureClient(enclave, repo string) *SecureClient {
7378
func NewPinnedSecureClient(enclave string, codeMeasurement *attestation.Measurement, hardwareMeasurements []*attestation.HardwareMeasurement) *SecureClient {
7479
return &SecureClient{
7580
enclave: enclave,
76-
repo: "pinned_no_repo",
81+
repo: pinnedNoRepo,
7782
codeMeasurement: codeMeasurement,
7883
hardwareMeasurements: hardwareMeasurements,
7984
}
@@ -141,7 +146,7 @@ func (s *SecureClient) getSigstoreClient() (*sigstore.Client, error) {
141146
// Verify fetches the latest verification information from GitHub and Sigstore and stores the ground truth results in the client
142147
func (s *SecureClient) Verify() (*GroundTruth, error) {
143148
var codeMeasurement = s.codeMeasurement
144-
var digest = "pinned_no_digest"
149+
var digest = pinnedNoDigest
145150
if s.codeMeasurement == nil {
146151
var err error
147152
digest, err = github.FetchLatestDigest(s.repo)

0 commit comments

Comments
 (0)