OAuth2ProviderAppSecrets returns the truncated secrets for an OAuth2 application.
(ctx context.Context, appID uuid.UUID)
| 144 | // OAuth2ProviderAppSecrets returns the truncated secrets for an OAuth2 |
| 145 | // application. |
| 146 | func (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. |