WWWAuthenticateChallenge is the v1-surface seam (internal/httpapi) for the RFC 6750 challenge. The legacy mux had the auth error in hand at the 401 site (writeAuthError); the v1 layer rejects via the canonical envelope and reaches this from a response wrapper that only knows the status was 401, so w
(r *http.Request)
| 862 | // resolution is cheap, and routing it through the one auth path keeps the |
| 863 | // surfaces from diverging. |
| 864 | func (a *API) WWWAuthenticateChallenge(r *http.Request) string { |
| 865 | _, err := a.authenticatePrincipal(r) |
| 866 | return a.authChallenge(r, err) |
| 867 | } |
| 868 | |
| 869 | // resolveAgentForUser loads an agent by email address and verifies the user owns it. |
| 870 | func (a *API) resolveAgentForUser(r *http.Request, email string, user *identity.User) (*identity.AgentIdentity, error) { |
nothing calls this directly
no test coverage detected