MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / validateWriterClient

Function validateWriterClient

pkg/credentials/vault/keyval.go:107–119  ·  view source on GitHub ↗

validateWriterClient checks if the client is valid by writing and deleting a secret in the provided mount path.

(kv *vault.KVv2, pathPrefix string)

Source from the content-addressed store, hash-verified

105// validateWriterClient checks if the client is valid by writing and deleting a secret
106// in the provided mount path.
107func validateWriterClient(kv *vault.KVv2, pathPrefix string) error {
108 ctx := context.Background()
109 keyPath := strings.Join([]string{pathPrefix, healthCheckSecret}, "/")
110 if _, err := kv.Put(ctx, keyPath, nil); err != nil {
111 return err
112 }
113
114 if err := kv.DeleteMetadata(ctx, keyPath); err != nil {
115 return fmt.Errorf("deleting health check secret: %w", err)
116 }
117
118 return nil
119}
120
121func validateReaderClient(kv *vault.KVv2, pathPrefix string) error {
122 ctx := context.Background()

Callers 1

NewManagerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected