resolvePrincipal runs the injected auth path. It prefers the scope-aware PrincipalAuthenticator; if only the legacy Authenticator is wired it treats the caller as account-scoped (pre-Slice-5a behavior — no scope ceiling).
(r *http.Request)
| 433 | // PrincipalAuthenticator; if only the legacy Authenticator is wired it treats |
| 434 | // the caller as account-scoped (pre-Slice-5a behavior — no scope ceiling). |
| 435 | func (s *Server) resolvePrincipal(r *http.Request) (*identity.Principal, error) { |
| 436 | if s.deps.PrincipalAuthenticator != nil { |
| 437 | return s.deps.PrincipalAuthenticator(r) |
| 438 | } |
| 439 | if s.deps.Authenticator == nil { |
| 440 | return nil, fmt.Errorf("authentication unavailable") |
| 441 | } |
| 442 | u, err := s.deps.Authenticator(r) |
| 443 | if err != nil { |
| 444 | return nil, err |
| 445 | } |
| 446 | return &identity.Principal{User: u, Scope: identity.ScopeAccount}, nil |
| 447 | } |
no outgoing calls
no test coverage detected