| 24 | } |
| 25 | |
| 26 | func getGPGKeys(httpClient *http.Client, host string) ([]gpgKey, error) { |
| 27 | u, err := safeurl.JoinPath("user", "gpg_keys") |
| 28 | if err != nil { |
| 29 | return nil, err |
| 30 | } |
| 31 | u.SetQuery("per_page", "100") |
| 32 | |
| 33 | var keys []gpgKey |
| 34 | // TODO(api-client-rollout) |
| 35 | // This line of code is part of a mechanical roll out of the api client. |
| 36 | // As a follow up, consider whether the api client can be injected to this call site, rather than constructed |
| 37 | err = api.NewClientFromHTTP(httpClient).REST(host, "GET", u.String(), nil, &keys) |
| 38 | if err != nil { |
| 39 | return nil, err |
| 40 | } |
| 41 | return keys, nil |
| 42 | } |