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

Method PutOAuth2ProviderApp

codersdk/oauth2.go:106–117  ·  view source on GitHub ↗

PutOAuth2ProviderApp updates an application that can authenticate using Coder as an OAuth2 provider.

(ctx context.Context, id uuid.UUID, app PutOAuth2ProviderAppRequest)

Source from the content-addressed store, hash-verified

104// PutOAuth2ProviderApp updates an application that can authenticate using Coder
105// as an OAuth2 provider.
106func (c *Client) PutOAuth2ProviderApp(ctx context.Context, id uuid.UUID, app PutOAuth2ProviderAppRequest) (OAuth2ProviderApp, error) {
107 res, err := c.Request(ctx, http.MethodPut, fmt.Sprintf("/api/v2/oauth2-provider/apps/%s", id), app)
108 if err != nil {
109 return OAuth2ProviderApp{}, err
110 }
111 defer res.Body.Close()
112 if res.StatusCode != http.StatusOK {
113 return OAuth2ProviderApp{}, ReadBodyAsError(res)
114 }
115 var resp OAuth2ProviderApp
116 return resp, json.NewDecoder(res.Body).Decode(&resp)
117}
118
119// DeleteOAuth2ProviderApp deletes an application, also invalidating any tokens
120// that were generated from it.

Callers 1

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65

Tested by 1