code: func (s *HTTPServer) AgentConnectAuthorize(resp http.ResponseWriter, req *http.Request) (interface{}, error) {
  	// Fetch the token
  	var token string
  	s.parseToken(req, &token)
  
  	// Decode the request from the request body
  	var authReq structs.ConnectAuthorizeRequest
  	if err := decodeBody(req, &authReq, nil); err != nil {
  		return nil, BadRequestError{fmt.Sprintf("Request decode failed: %v", err)}
  	}
  
  	authz, reason, cacheMeta, err := s.agent.ConnectAuthorize(token, &authReq)
  	if err != nil {
  		return nil, err
  	}
  	setCacheMeta(resp, cacheMeta)
  
  	return &connectAuthorizeResp{
  		Authorized: authz,
  		Reason:     reason,
  	}, nil
  }
docs: // AgentConnectAuthorize
  //
  // POST /v1/agent/connect/authorize
  //
  // Note: when this logic changes, consider if the Intention.Check RPC method
  // also needs to be updated.