MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / Set

Method Set

internal/cli/credentials.go:185–195  ·  view source on GitHub ↗

Set adds or replaces the credential for the given server URL. The canonical URL is mirrored into the value's ServerURL field so a caller reading the credential standalone still sees a consistent URL. Passing a nil credential is a no-op (use Delete to remove).

(serverURL string, c *Credentials)

Source from the content-addressed store, hash-verified

183// caller reading the credential standalone still sees a consistent
184// URL. Passing a nil credential is a no-op (use Delete to remove).
185func (s *CredentialStore) Set(serverURL string, c *Credentials) {
186 if c == nil {
187 return
188 }
189 if s.Credentials == nil {
190 s.Credentials = map[string]*Credentials{}
191 }
192 key := normalizeServerURL(serverURL)
193 c.ServerURL = key
194 s.Credentials[key] = c
195}
196
197// Delete removes the credential for the given server URL. No-op if the
198// entry isn't present, or if the receiver is nil.

Calls 1

normalizeServerURLFunction · 0.85