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

Method listOAuth2Clients

client/handler.go:527–556  ·  view source on GitHub ↗

swagger:route GET /admin/clients oAuth2 listOAuth2Clients # List OAuth 2.0 Clients This endpoint lists all clients in the database, and never returns client secrets. As a default it lists the first 100 clients. Consumes: - application/json Produces: - application/json Schemes: http, https

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

Source from the content-addressed store, hash-verified

525// Extensions:
526// x-ory-ratelimit-bucket: hydra-admin-medium
527func (h *Handler) listOAuth2Clients(w http.ResponseWriter, r *http.Request) {
528 pageKeys := h.r.Config().GetPaginationEncryptionKeys(r.Context())
529 pagination, err := keysetpagination.ParseQueryParams(pageKeys, r.URL.Query())
530 if err != nil {
531 h.r.Writer().WriteError(w, r, errors.WithStack(herodot.ErrBadRequest.WithReasonf("Unable to parse pagination parameters: %s", err)))
532 return
533 }
534 filters := Filter{
535 PageOpts: pagination,
536 Name: r.URL.Query().Get("client_name"),
537 Owner: r.URL.Query().Get("owner"),
538 }
539
540 c, nextPage, err := h.r.ClientManager().GetClients(r.Context(), filters)
541 if err != nil {
542 h.r.Writer().WriteError(w, r, err)
543 return
544 }
545
546 if c == nil {
547 c = []Client{}
548 }
549
550 for k := range c {
551 c[k].Secret = ""
552 }
553
554 keysetpagination.SetLinkHeader(w, pageKeys, r.URL, nextPage)
555 h.r.Writer().Write(w, r, c)
556}
557
558// Get OAuth2 Client Parameters
559//

Callers

nothing calls this directly

Calls 7

ConfigMethod · 0.65
WriterMethod · 0.65
GetMethod · 0.65
GetClientsMethod · 0.65
ClientManagerMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected