MCPcopy Create free account
hub / github.com/conforma/cli / SetTestRekorPublicKey

Function SetTestRekorPublicKey

internal/utils/testing_sigstore.go:134–143  ·  view source on GitHub ↗

#nosec G101 SetTestRekorPublicKey writes the test Rekor public key to disk and sets the corresponding environment variable to make it available to cosign.

(t *testing.T)

Source from the content-addressed store, hash-verified

132// SetTestRekorPublicKey writes the test Rekor public key to disk and sets the corresponding
133// environment variable to make it available to cosign.
134func SetTestRekorPublicKey(t *testing.T) {
135 // Do not use afero.NewMemMapFs() here because the file is read by cosign
136 // which does not understand the filesystem-from-context pattern
137 f, err := os.Create(path.Join(t.TempDir(), "rekor.pub"))
138 assert.NoError(t, err)
139 defer f.Close()
140 _, err = f.Write([]byte(TestRekorPublicKey))
141 assert.NoError(t, err)
142 t.Setenv("SIGSTORE_REKOR_PUBLIC_KEY", f.Name())
143}

Callers 15

TestNewPolicyFunction · 0.92
TestCheckOptsFunction · 0.92
TestPublicKeyPEMFunction · 0.92
TestIdentityFunction · 0.92
TestSigstoreOptsFunction · 0.92
TestSkipAttSigCheckFunction · 0.92
createTestPolicyFunction · 0.92
TestSigstoreVerifyImageFunction · 0.92

Calls 3

CloseMethod · 0.65
NameMethod · 0.65
WriteMethod · 0.45

Tested by 15

TestNewPolicyFunction · 0.74
TestCheckOptsFunction · 0.74
TestPublicKeyPEMFunction · 0.74
TestIdentityFunction · 0.74
TestSigstoreOptsFunction · 0.74
TestSkipAttSigCheckFunction · 0.74
createTestPolicyFunction · 0.74
TestSigstoreVerifyImageFunction · 0.74