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

Method PostOAuth2ProviderAppSecret

codersdk/oauth2.go:161–172  ·  view source on GitHub ↗

PostOAuth2ProviderAppSecret creates a new secret for an OAuth2 application. This is the only time the full secret will be revealed.

(ctx context.Context, appID uuid.UUID)

Source from the content-addressed store, hash-verified

159// PostOAuth2ProviderAppSecret creates a new secret for an OAuth2 application.
160// This is the only time the full secret will be revealed.
161func (c *Client) PostOAuth2ProviderAppSecret(ctx context.Context, appID uuid.UUID) (OAuth2ProviderAppSecretFull, error) {
162 res, err := c.Request(ctx, http.MethodPost, fmt.Sprintf("/api/v2/oauth2-provider/apps/%s/secrets", appID), nil)
163 if err != nil {
164 return OAuth2ProviderAppSecretFull{}, err
165 }
166 defer res.Body.Close()
167 if res.StatusCode != http.StatusCreated {
168 return OAuth2ProviderAppSecretFull{}, ReadBodyAsError(res)
169 }
170 var resp OAuth2ProviderAppSecretFull
171 return resp, json.NewDecoder(res.Body).Decode(&resp)
172}
173
174// DeleteOAuth2ProviderAppSecret deletes a secret from an OAuth2 application,
175// also invalidating any tokens that generated from it.

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65