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

Method requireUser

internal/httpapi/httpapi.go:404–410  ·  view source on GitHub ↗

requireUser authenticates the caller or returns a 401 envelope carrying the machine-branchable "unauthorized" code.

(ctx context.Context)

Source from the content-addressed store, hash-verified

402// requireUser authenticates the caller or returns a 401 envelope carrying
403// the machine-branchable "unauthorized" code.
404func (s *Server) requireUser(ctx context.Context) (*identity.User, error) {
405 p, err := s.requirePrincipal(ctx)
406 if err != nil {
407 return nil, err
408 }
409 return p.User, nil
410}
411
412// requirePrincipal authenticates the caller and returns the full principal
413// (user + scope + bound agent), or a 401 envelope. The scope-aware basis for

Callers 3

handleTestSendMethod · 0.95
loadInboundMethod · 0.95
handleCreateMessageMethod · 0.95

Calls 1

requirePrincipalMethod · 0.95

Tested by

no test coverage detected