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)
| 681 | // + bound agent) so the v1 layer can enforce the hard scope ceiling. There is |
| 682 | // still exactly one place credentials are checked. |
| 683 | func (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. |