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

Method AuthenticateUser

internal/agent/api.go:671–677  ·  view source on GitHub ↗

authenticateUser extracts and validates the bearer credential from the request, returning the owning user. Dispatch is by token prefix: - ate2a_ → OAuth access token (fosite-validated via the configured provider). Rejected if missing, revoked, expired, or the provider isn't wired. - anything else

(r *http.Request)

Source from the content-addressed store, hash-verified

669// resolution path (API key, OAuth bearer, session cookie) instead of
670// forking a second one. There is one place credentials are checked.
671func (a *API) AuthenticateUser(r *http.Request) (*identity.User, error) {
672 p, err := a.authenticatePrincipal(r)
673 if err != nil {
674 return nil, err
675 }
676 return p.User, nil
677}
678
679// AuthenticatePrincipal is the scope-aware seam (Slice 5a): same credential
680// resolution as AuthenticateUser, but returns the full principal (user + scope

Callers

nothing calls this directly

Calls 1

authenticatePrincipalMethod · 0.95

Tested by

no test coverage detected