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

Function keyFromFile

internal/utils/key_resolver.go:60–66  ·  view source on GitHub ↗

keyFromFile reads a key from the filesystem

(keyPath string, fs afero.Fs)

Source from the content-addressed store, hash-verified

58
59// keyFromFile reads a key from the filesystem
60func keyFromFile(keyPath string, fs afero.Fs) ([]byte, error) {
61 keyBytes, err := afero.ReadFile(fs, keyPath)
62 if err != nil {
63 return nil, fmt.Errorf("read key from file %q: %w", keyPath, err)
64 }
65 return keyBytes, nil
66}
67
68// keyFromKubernetesSecret reads a key from a Kubernetes secret
69// Supported formats:

Callers 1

KeyFromKeyRefFunction · 0.85

Calls 1

ErrorfMethod · 0.65

Tested by

no test coverage detected