requireUser authenticates the caller or returns a 401 envelope carrying the machine-branchable "unauthorized" code.
(ctx context.Context)
| 402 | // requireUser authenticates the caller or returns a 401 envelope carrying |
| 403 | // the machine-branchable "unauthorized" code. |
| 404 | func (s *Server) requireUser(ctx context.Context) (*identity.User, error) { |
| 405 | p, err := s.requirePrincipal(ctx) |
| 406 | if err != nil { |
| 407 | return nil, err |
| 408 | } |
| 409 | return p.User, nil |
| 410 | } |
| 411 | |
| 412 | // requirePrincipal authenticates the caller and returns the full principal |
| 413 | // (user + scope + bound agent), or a 401 envelope. The scope-aware basis for |
no test coverage detected