MCPcopy
hub / github.com/ory/hydra / makeOAuth2DeviceVerificationRequest

Function makeOAuth2DeviceVerificationRequest

consent/strategy_default_test.go:121–133  ·  view source on GitHub ↗
(t *testing.T, reg *driver.RegistrySQL, hc *http.Client, oc *client.Client, values url.Values)

Source from the content-addressed store, hash-verified

119}
120
121func 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
135func createClient(t *testing.T, reg *driver.RegistrySQL, c *client.Client) *client.Client {
136 secret := uuid.Must(uuid.NewV4()).String()

Callers 1

Calls 7

PublicURLMethod · 0.80
AddMethod · 0.65
GetIDMethod · 0.65
GetMethod · 0.65
StringMethod · 0.65
ConfigMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected