MCPcopy Index your code
hub / github.com/coder/coder / OAuth2ProviderApps

Method OAuth2ProviderApps

codersdk/oauth2.go:42–60  ·  view source on GitHub ↗

OAuth2ProviderApps returns the applications configured to authenticate using Coder as an OAuth2 provider.

(ctx context.Context, filter OAuth2ProviderAppFilter)

Source from the content-addressed store, hash-verified

40// OAuth2ProviderApps returns the applications configured to authenticate using
41// Coder as an OAuth2 provider.
42func (c *Client) OAuth2ProviderApps(ctx context.Context, filter OAuth2ProviderAppFilter) ([]OAuth2ProviderApp, error) {
43 res, err := c.Request(ctx, http.MethodGet, "/api/v2/oauth2-provider/apps", nil,
44 func(r *http.Request) {
45 if filter.UserID != uuid.Nil {
46 q := r.URL.Query()
47 q.Set("user_id", filter.UserID.String())
48 r.URL.RawQuery = q.Encode()
49 }
50 })
51 if err != nil {
52 return []OAuth2ProviderApp{}, err
53 }
54 defer res.Body.Close()
55 if res.StatusCode != http.StatusOK {
56 return []OAuth2ProviderApp{}, ReadBodyAsError(res)
57 }
58 var apps []OAuth2ProviderApp
59 return apps, json.NewDecoder(res.Body).Decode(&apps)
60}
61
62// OAuth2ProviderApp returns an application configured to authenticate using
63// Coder as an OAuth2 provider.

Callers 2

TestOAuth2ProviderRevokeFunction · 0.80

Calls 6

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
EncodeMethod · 0.80
SetMethod · 0.65
CloseMethod · 0.65
StringMethod · 0.45

Tested by 2

TestOAuth2ProviderRevokeFunction · 0.64