MCPcopy Index your code
hub / github.com/chainloop-dev/chainloop / validateReaderClient

Function validateReaderClient

pkg/credentials/vault/keyval.go:121–137  ·  view source on GitHub ↗
(kv *vault.KVv2, pathPrefix string)

Source from the content-addressed store, hash-verified

119}
120
121func validateReaderClient(kv *vault.KVv2, pathPrefix string) error {
122 ctx := context.Background()
123 // try to retrieve a non-existing key
124 // if we get 404 means that we have permissions to read in that path
125 keyPath := strings.Join([]string{pathPrefix, healthCheckNonExisting}, "/")
126 _, err := kv.Get(ctx, keyPath)
127 if err != nil {
128 if errors.Is(err, vault.ErrSecretNotFound) {
129 // Everything is ok
130 return nil
131 }
132
133 return err
134 }
135
136 return nil
137}
138
139func (m *Manager) SaveCredentials(ctx context.Context, orgID string, creds any, opts ...credentials.SaveOption) (string, error) {
140 credsM, err := structToMap(creds)

Callers 1

NewManagerFunction · 0.85

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected