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

Method PutOAuth2ClientConfiguration

codersdk/oauth2.go:594–608  ·  view source on GitHub ↗

PutOAuth2ClientConfiguration updates client configuration (RFC 7592)

(ctx context.Context, clientID string, registrationAccessToken string, req OAuth2ClientRegistrationRequest)

Source from the content-addressed store, hash-verified

592
593// PutOAuth2ClientConfiguration updates client configuration (RFC 7592)
594func (c *Client) PutOAuth2ClientConfiguration(ctx context.Context, clientID string, registrationAccessToken string, req OAuth2ClientRegistrationRequest) (OAuth2ClientConfiguration, error) {
595 res, err := c.Request(ctx, http.MethodPut, fmt.Sprintf("/oauth2/clients/%s", clientID), req,
596 func(r *http.Request) {
597 r.Header.Set("Authorization", "Bearer "+registrationAccessToken)
598 })
599 if err != nil {
600 return OAuth2ClientConfiguration{}, err
601 }
602 defer res.Body.Close()
603 if res.StatusCode != http.StatusOK {
604 return OAuth2ClientConfiguration{}, ReadBodyAsError(res)
605 }
606 var resp OAuth2ClientConfiguration
607 return resp, json.NewDecoder(res.Body).Decode(&resp)
608}
609
610// DeleteOAuth2ClientConfiguration deletes client registration (RFC 7592)
611func (c *Client) DeleteOAuth2ClientConfiguration(ctx context.Context, clientID string, registrationAccessToken string) error {

Calls 4

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
SetMethod · 0.65
CloseMethod · 0.65