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

Method RevokeOAuth2ProviderApp

codersdk/oauth2.go:396–410  ·  view source on GitHub ↗

RevokeOAuth2ProviderApp completely revokes an app's access for the authenticated user.

(ctx context.Context, appID uuid.UUID)

Source from the content-addressed store, hash-verified

394// RevokeOAuth2ProviderApp completely revokes an app's access for the
395// authenticated user.
396func (c *Client) RevokeOAuth2ProviderApp(ctx context.Context, appID uuid.UUID) error {
397 res, err := c.Request(ctx, http.MethodDelete, "/oauth2/tokens", nil, func(r *http.Request) {
398 q := r.URL.Query()
399 q.Set("client_id", appID.String())
400 r.URL.RawQuery = q.Encode()
401 })
402 if err != nil {
403 return err
404 }
405 defer res.Body.Close()
406 if res.StatusCode != http.StatusNoContent {
407 return ReadBodyAsError(res)
408 }
409 return nil
410}
411
412type OAuth2DeviceFlowCallbackResponse struct {
413 RedirectURL string `json:"redirect_url"`

Callers 1

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 1

TestOAuth2ProviderRevokeFunction · 0.64