MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / principalFromContext

Function principalFromContext

internal/httpapi/ratelimit.go:121–126  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

119}
120
121func principalFromContext(ctx context.Context) *identity.Principal {
122 if p, ok := ctx.Value(principalCtxKey{}).(*identity.Principal); ok {
123 return p
124 }
125 return nil
126}
127
128func userFromContext(ctx context.Context) *identity.User {
129 if p := principalFromContext(ctx); p != nil {

Callers 2

requirePrincipalMethod · 0.85
userFromContextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected