MCPcopy Index your code
hub / github.com/coder/coder / userDebugOIDC

Method userDebugOIDC

coderd/users.go:47–73  ·  view source on GitHub ↗

userDebugOIDC returns the OIDC debug context for the user. Not going to expose this via swagger as the return payload is not guaranteed to be consistent between releases. @Summary Debug OIDC context for a user @ID debug-oidc-context-for-a-user @Security CoderSessionToken @Tags Agents @Success 200 "

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

Source from the content-addressed store, hash-verified

45// @Router /api/v2/debug/{user}/debug-link [get]
46// @x-apidocgen {"skip": true}
47func (api *API) userDebugOIDC(rw http.ResponseWriter, r *http.Request) {
48 var (
49 ctx = r.Context()
50 user = httpmw.UserParam(r)
51 )
52
53 if user.LoginType != database.LoginTypeOIDC {
54 httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
55 Message: "User is not an OIDC user.",
56 })
57 return
58 }
59
60 link, err := api.Database.GetUserLinkByUserIDLoginType(ctx, database.GetUserLinkByUserIDLoginTypeParams{
61 UserID: user.ID,
62 LoginType: database.LoginTypeOIDC,
63 })
64 if err != nil {
65 httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
66 Message: "Failed to get user links.",
67 Detail: err.Error(),
68 })
69 return
70 }
71
72 httpapi.Write(ctx, rw, http.StatusOK, link.Claims)
73}
74
75// Returns the merged OIDC claims for the authenticated user.
76//

Callers

nothing calls this directly

Calls 5

UserParamFunction · 0.92
WriteFunction · 0.92
ContextMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected