MCPcopy Create free account
hub / github.com/diillson/chatcli / UserFromContext

Function UserFromContext

server/security_context.go:64–67  ·  view source on GitHub ↗

UserFromContext extracts the UserInfo from context. Returns nil if not present.

(ctx context.Context)

Source from the content-addressed store, hash-verified

62
63// UserFromContext extracts the UserInfo from context. Returns nil if not present.
64func UserFromContext(ctx context.Context) *UserInfo {
65 u, _ := ctx.Value(userInfoKey).(*UserInfo)
66 return u
67}
68
69// RequireRole checks that the context has a user with at least the given role.
70// Returns the UserInfo on success or an error suitable for gRPC status responses.

Callers 10

ListRemotePluginsMethod · 0.85
ExecuteRemotePluginMethod · 0.85
RequireRoleFunction · 0.85
extractClientIDMethod · 0.85
hubPrincipalMethod · 0.85
authorizeConvMethod · 0.85
ListBindingsMethod · 0.85
extractClientIDFunction · 0.85

Calls

no outgoing calls