code: func (s *Server) authenticate() router.Middleware {
  	a := s.Authenticator
  	if a == nil {
  		a = GetDefaultAuth()
  		if a == nil {
  			panic("prpc: no custom Authenticator was provided and default authenticator was not registered.\n" +
  				"Either explicitly set `Server.Authenticator = NoAuthentication`, or use RegisterDefaultAuth()")
  		}
  	}
  
  	return func(c *router.Context, next router.Handler) {
  		switch ctx, err := a.Authenticate(c.Context, c.Request); {
  		case transient.Tag.In(err):
  			writeError(c.Context, c.Writer, withCode(err, codes.Internal))
  		case err != nil:
  			writeError(c.Context, c.Writer, withCode(err, codes.Unauthenticated))
  		default:
  			c.Context = ctx
  			next(c)
  		}
  	}
  }
docs: // authenticate forces authentication set by RegisterDefaultAuth.