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

Function setupRekor

acceptance/cli/cli.go:298–324  ·  view source on GitHub ↗
(ctx context.Context, vars map[string]string, environment []string)

Source from the content-addressed store, hash-verified

296}
297
298func setupRekor(ctx context.Context, vars map[string]string, environment []string) ([]string, map[string]string, error) {
299 if !rekor.IsRunning(ctx) {
300 return environment, vars, nil
301 }
302
303 rekorURL, err := rekor.StubRekor(ctx)
304 if err != nil {
305 return environment, vars, err
306 }
307
308 vars["REKOR"] = rekorURL
309
310 // If TUF is initialized, skip setting SIGSTORE_REKOR_PUBLIC_KEY to avoid conflicts.
311 if !tuf.Initialized(ctx) {
312 f, err := os.CreateTemp("", "ec-acceptance-rekor-pub-*")
313 if err != nil {
314 return environment, vars, err
315 }
316 defer f.Close()
317 if _, err := f.Write(rekor.PublicKey(ctx)); err != nil {
318 return environment, vars, err
319 }
320 environment = append(environment, fmt.Sprintf("SIGSTORE_REKOR_PUBLIC_KEY=%s", f.Name()))
321 }
322
323 return environment, vars, nil
324}
325
326func setupRegistry(ctx context.Context, vars map[string]string, environment []string) ([]string, map[string]string, error) {
327 if !registry.IsRunning(ctx) {

Callers 1

variablesFunction · 0.85

Calls 7

IsRunningFunction · 0.92
StubRekorFunction · 0.92
InitializedFunction · 0.92
PublicKeyFunction · 0.92
CloseMethod · 0.65
NameMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected