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

Method OAuth2ProviderAppSecrets

codersdk/oauth2.go:146–157  ·  view source on GitHub ↗

OAuth2ProviderAppSecrets returns the truncated secrets for an OAuth2 application.

(ctx context.Context, appID uuid.UUID)

Source from the content-addressed store, hash-verified

144// OAuth2ProviderAppSecrets returns the truncated secrets for an OAuth2
145// application.
146func (c *Client) OAuth2ProviderAppSecrets(ctx context.Context, appID uuid.UUID) ([]OAuth2ProviderAppSecret, error) {
147 res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/oauth2-provider/apps/%s/secrets", appID), nil)
148 if err != nil {
149 return []OAuth2ProviderAppSecret{}, err
150 }
151 defer res.Body.Close()
152 if res.StatusCode != http.StatusOK {
153 return []OAuth2ProviderAppSecret{}, ReadBodyAsError(res)
154 }
155 var resp []OAuth2ProviderAppSecret
156 return resp, json.NewDecoder(res.Body).Decode(&resp)
157}
158
159// PostOAuth2ProviderAppSecret creates a new secret for an OAuth2 application.
160// This is the only time the full secret will be revealed.

Callers 1

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65

Tested by 1