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

Function getUserKeys

pkg/cmd/ssh-key/shared/user_keys.go:76–87  ·  view source on GitHub ↗
(httpClient *http.Client, hostname string, u safeurl.SafeURL)

Source from the content-addressed store, hash-verified

74}
75
76func getUserKeys(httpClient *http.Client, hostname string, u safeurl.SafeURL) ([]sshKey, error) {
77 var keys []sshKey
78 // TODO(api-client-rollout)
79 // This line of code is part of a mechanical roll out of the api client.
80 // As a follow up, consider whether the api client can be injected to this call site, rather than constructed
81 err := api.NewClientFromHTTP(httpClient).REST(hostname, http.MethodGet, u.String(), nil, &keys)
82 if err != nil {
83 return nil, err
84 }
85
86 return keys, nil
87}

Callers 2

UserKeysFunction · 0.85
UserSigningKeysFunction · 0.85

Calls 3

NewClientFromHTTPFunction · 0.92
RESTMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected