swagger:route PUT /admin/clients/{id} oAuth2 setOAuth2Client # Set OAuth 2.0 Client Replaces an existing OAuth 2.0 Client with the payload you send. If you pass `client_secret` the secret is used, otherwise the existing secret is used. If set, the secret is echoed in the response. It is not possi
(w http.ResponseWriter, r *http.Request)
| 256 | // Extensions: |
| 257 | // x-ory-ratelimit-bucket: hydra-admin-high |
| 258 | func (h *Handler) setOAuth2Client(w http.ResponseWriter, r *http.Request) { |
| 259 | var c Client |
| 260 | if err := json.NewDecoder(r.Body).Decode(&c); err != nil { |
| 261 | h.r.Writer().WriteError(w, r, errors.WithStack(herodot.ErrBadRequest.WithReasonf("Unable to decode the request body: %s", err))) |
| 262 | return |
| 263 | } |
| 264 | |
| 265 | c.ID = r.PathValue("id") |
| 266 | if err := h.updateClient(r.Context(), &c, h.r.ClientValidator().Validate); err != nil { |
| 267 | h.r.Writer().WriteError(w, r, err) |
| 268 | return |
| 269 | } |
| 270 | |
| 271 | h.r.Writer().Write(w, r, &c) |
| 272 | } |
| 273 | |
| 274 | func (h *Handler) updateClient(ctx context.Context, c *Client, validator func(context.Context, *Client) error) error { |
| 275 | var secret string |
nothing calls this directly
no test coverage detected