| 119 | } |
| 120 | |
| 121 | func makeOAuth2DeviceVerificationRequest(t *testing.T, reg *driver.RegistrySQL, hc *http.Client, oc *client.Client, values url.Values) (gjson.Result, *http.Response) { |
| 122 | ctx := context.Background() |
| 123 | if hc == nil { |
| 124 | hc = testhelpers.NewEmptyJarClient(t) |
| 125 | } |
| 126 | |
| 127 | values.Add("client_id", oc.GetID()) |
| 128 | res, err := hc.Get(urlx.CopyWithQuery(urlx.AppendPaths(reg.Config().PublicURL(ctx), oauth2.DeviceVerificationPath), values).String()) |
| 129 | require.NoError(t, err) |
| 130 | defer res.Body.Close() //nolint:errcheck |
| 131 | |
| 132 | return gjson.ParseBytes(ioutilx.MustReadAll(res.Body)), res |
| 133 | } |
| 134 | |
| 135 | func createClient(t *testing.T, reg *driver.RegistrySQL, c *client.Client) *client.Client { |
| 136 | secret := uuid.Must(uuid.NewV4()).String() |