PutOAuth2ProviderApp updates an application that can authenticate using Coder as an OAuth2 provider.
(ctx context.Context, id uuid.UUID, app PutOAuth2ProviderAppRequest)
| 104 | // PutOAuth2ProviderApp updates an application that can authenticate using Coder |
| 105 | // as an OAuth2 provider. |
| 106 | func (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. |