MCPcopy
hub / github.com/perkeep/perkeep / testSigner

Function testSigner

pkg/search/handler_test.go:128–142  ·  view source on GitHub ↗

testSigner returns the signer, as well as its armored public key, from pkg/jsonsign/testdata/test-secring.gpg

()

Source from the content-addressed store, hash-verified

126// testSigner returns the signer, as well as its armored public key, from
127// pkg/jsonsign/testdata/test-secring.gpg
128func testSigner() *schema.Signer {
129 srcRoot, err := osutil.PkSourceRoot()
130 if err != nil {
131 panic(fmt.Sprintf("source root folder not found: %v", err))
132 }
133 ent, err := jsonsign.EntityFromSecring(indextest.KeyID, filepath.Join(srcRoot, "pkg", "jsonsign", "testdata", "test-secring.gpg"))
134 if err != nil {
135 panic(err)
136 }
137 sig, err := schema.NewSigner(owner.BlobRef(), strings.NewReader(ownerRef.Contents), ent)
138 if err != nil {
139 panic(err)
140 }
141 return sig
142}
143
144// fetcherIndex groups addBlob, addClaim, and addPermanode, that are all methods
145// to write both to the Fetcher and the Index.

Callers 1

initFunction · 0.85

Calls 4

PkSourceRootFunction · 0.92
EntityFromSecringFunction · 0.92
NewSignerFunction · 0.92
BlobRefMethod · 0.65

Tested by

no test coverage detected