MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / currentUser

Function currentUser

internal/server/middleware_auth.go:452–455  ·  view source on GitHub ↗

currentUser returns the authenticated user from the request context, or nil if no user is authenticated.

(r *http.Request)

Source from the content-addressed store, hash-verified

450// currentUser returns the authenticated user from the request context,
451// or nil if no user is authenticated.
452func currentUser(r *http.Request) *models.User {
453 u, _ := r.Context().Value(ctxCurrentUser).(*models.User)
454 return u
455}
456
457// isAPITokenAuth returns true if the request was authenticated via an API token
458// (not a session cookie or CLI session). Use this to gate sensitive operations

Callers 15

rateLimitKeyFunction · 0.85
handleCollabMethod · 0.85
actorIDFromRequestFunction · 0.85
authorizeCollabAccessMethod · 0.85
actorNameFromRequestFunction · 0.85
resolverItemVisibleMethod · 0.85
getWorkspaceIDMethod · 0.85
getWorkspaceMethod · 0.85
visibleCollectionIDsMethod · 0.85
requireItemVisibleMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected