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

Method OAuth2ProviderApp

codersdk/oauth2.go:64–75  ·  view source on GitHub ↗

OAuth2ProviderApp returns an application configured to authenticate using Coder as an OAuth2 provider.

(ctx context.Context, id uuid.UUID)

Source from the content-addressed store, hash-verified

62// OAuth2ProviderApp returns an application configured to authenticate using
63// Coder as an OAuth2 provider.
64func (c *Client) OAuth2ProviderApp(ctx context.Context, id uuid.UUID) (OAuth2ProviderApp, error) {
65 res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/oauth2-provider/apps/%s", id), nil)
66 if err != nil {
67 return OAuth2ProviderApp{}, err
68 }
69 defer res.Body.Close()
70 if res.StatusCode != http.StatusOK {
71 return OAuth2ProviderApp{}, ReadBodyAsError(res)
72 }
73 var apps OAuth2ProviderApp
74 return apps, json.NewDecoder(res.Body).Decode(&apps)
75}
76
77type PostOAuth2ProviderAppRequest struct {
78 Name string `json:"name" validate:"required,oauth2_app_name"`

Callers 1

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65

Tested by 1