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

Function WipeCredentialsFile

internal/cli/credentials.go:239–248  ·  view source on GitHub ↗

WipeCredentialsFile removes ~/.pad/credentials.json entirely. Distinct from CredentialStore.Delete (which removes a single server's entry) — used by tests and any future "pad auth wipe" that wants a clean slate. Silently succeeds if the file is already absent.

()

Source from the content-addressed store, hash-verified

237// — used by tests and any future "pad auth wipe" that wants a clean
238// slate. Silently succeeds if the file is already absent.
239func WipeCredentialsFile() error {
240 path, err := credentialsPath()
241 if err != nil {
242 return err
243 }
244 if err := os.Remove(path); err != nil && !os.IsNotExist(err) {
245 return fmt.Errorf("delete credentials: %w", err)
246 }
247 return nil
248}
249
250// normalizeServerURL canonicalizes a server URL for use as a credential
251// key. Trailing slash and surrounding whitespace are stripped; nothing

Callers 1

TestWipeCredentialsFileFunction · 0.85

Calls 1

credentialsPathFunction · 0.85

Tested by 1

TestWipeCredentialsFileFunction · 0.68