MCPcopy
hub / github.com/ory/hydra / deleteOidcDynamicClient

Method deleteOidcDynamicClient

client/handler.go:819–836  ·  view source on GitHub ↗

swagger:route DELETE /oauth2/register/{id} oidc deleteOidcDynamicClient # Delete OAuth 2.0 Client using the OpenID Dynamic Client Registration Management Protocol This endpoint behaves like the administrative counterpart (`deleteOAuth2Client`) but is capable of facing the public internet directly

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

817// Extensions:
818// x-ory-ratelimit-bucket: hydra-public-high
819func (h *Handler) deleteOidcDynamicClient(w http.ResponseWriter, r *http.Request) {
820 if err := h.requireDynamicAuth(r); err != nil {
821 h.r.Writer().WriteError(w, r, err)
822 return
823 }
824 client, err := h.ValidDynamicAuth(r, r.PathValue("id"))
825 if err != nil {
826 h.r.Writer().WriteError(w, r, err)
827 return
828 }
829
830 if err := h.r.ClientManager().DeleteClient(r.Context(), client.GetID()); err != nil {
831 h.r.Writer().WriteError(w, r, err)
832 return
833 }
834
835 w.WriteHeader(http.StatusNoContent)
836}
837
838func (h *Handler) ValidDynamicAuth(r *http.Request, id string) (fosite.Client, error) {
839 c, err := h.r.ClientManager().GetConcreteClient(r.Context(), id)

Callers

nothing calls this directly

Calls 7

requireDynamicAuthMethod · 0.95
ValidDynamicAuthMethod · 0.95
WriterMethod · 0.65
DeleteClientMethod · 0.65
ClientManagerMethod · 0.65
GetIDMethod · 0.65
WriteHeaderMethod · 0.45

Tested by

no test coverage detected