MCPcopy
hub / github.com/harness/harness / HandleFind

Function HandleFind

app/api/handler/users/find.go:27–45  ·  view source on GitHub ↗

HandleFind returns an http.HandlerFunc that writes json-encoded user account information to the response body.

(userCtrl *user.Controller)

Source from the content-addressed store, hash-verified

25// HandleFind returns an http.HandlerFunc that writes json-encoded
26// user account information to the response body.
27func HandleFind(userCtrl *user.Controller) http.HandlerFunc {
28 return func(w http.ResponseWriter, r *http.Request) {
29 ctx := r.Context()
30 session, _ := request.AuthSessionFrom(ctx)
31 userUID, err := request.GetUserUIDFromPath(r)
32 if err != nil {
33 render.TranslatedUserError(ctx, w, err)
34 return
35 }
36
37 usr, err := userCtrl.Find(ctx, session, userUID)
38 if err != nil {
39 render.TranslatedUserError(ctx, w, err)
40 return
41 }
42
43 render.JSON(w, http.StatusOK, usr)
44 }
45}

Callers 1

setupAdminFunction · 0.92

Calls 5

AuthSessionFromFunction · 0.92
GetUserUIDFromPathFunction · 0.92
TranslatedUserErrorFunction · 0.92
JSONFunction · 0.92
FindMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…