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

Function confirmDeletion

app/cli/cmd/auth_delete_account.go:66–78  ·  view source on GitHub ↗

confirmDeletion asks the user to type a random string

()

Source from the content-addressed store, hash-verified

64
65// confirmDeletion asks the user to type a random string
66func confirmDeletion() error {
67 wantChallenge := deletionChallenge()
68 fmt.Printf("To confirm, please type %q\n", wantChallenge)
69
70 var gotChallenge string
71 fmt.Scanln(&gotChallenge)
72
73 if gotChallenge != wantChallenge {
74 return errors.New("confirmation code does not match")
75 }
76
77 return nil
78}
79
80// deletionChallenge generates a random string
81func deletionChallenge() string {

Callers 4

newAuthDeleteAccountCmdFunction · 0.85
newOrganizationLeaveCmdFunction · 0.85
newOrganizationDeleteCmdFunction · 0.85

Calls 1

deletionChallengeFunction · 0.85

Tested by

no test coverage detected