MCPcopy Create free account
hub / github.com/cli/cli / deleteSSHKey

Function deleteSSHKey

pkg/cmd/ssh-key/delete/http.go:14–23  ·  view source on GitHub ↗
(httpClient *http.Client, host string, keyID string)

Source from the content-addressed store, hash-verified

12}
13
14func deleteSSHKey(httpClient *http.Client, host string, keyID string) error {
15 path, err := safeurl.JoinPath("user", "keys", keyID)
16 if err != nil {
17 return err
18 }
19 // TODO(api-client-rollout)
20 // This line of code is part of a mechanical roll out of the api client.
21 // As a follow up, consider whether the api client can be injected to this call site, rather than constructed
22 return api.NewClientFromHTTP(httpClient).REST(host, http.MethodDelete, path.String(), nil, nil)
23}
24
25func getSSHKey(httpClient *http.Client, host string, keyID string) (*sshKey, error) {
26 var key sshKey

Callers 2

deleteRunFunction · 0.85

Calls 4

JoinPathFunction · 0.92
NewClientFromHTTPFunction · 0.92
RESTMethod · 0.65
StringMethod · 0.65

Tested by 1