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

Method AuthenticatePrincipal

internal/agent/api.go:683–685  ·  view source on GitHub ↗

AuthenticatePrincipal is the scope-aware seam (Slice 5a): same credential resolution as AuthenticateUser, but returns the full principal (user + scope + bound agent) so the v1 layer can enforce the hard scope ceiling. There is still exactly one place credentials are checked.

(r *http.Request)

Source from the content-addressed store, hash-verified

681// + bound agent) so the v1 layer can enforce the hard scope ceiling. There is
682// still exactly one place credentials are checked.
683func (a *API) AuthenticatePrincipal(r *http.Request) (*identity.Principal, error) {
684 return a.authenticatePrincipal(r)
685}
686
687// authenticateUser is the user-only convenience over authenticatePrincipal,
688// retained for the legacy mux handlers (OAuth / session auth) that do not enforce the v1 scope ceiling.

Calls 1

authenticatePrincipalMethod · 0.95