diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index bad6f5d469..ae3dc99654 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1419,7 +1419,6 @@ phutil_register_library_map(array( 'PhabricatorConduitAPIController' => 'applications/conduit/controller/PhabricatorConduitAPIController.php', 'PhabricatorConduitApplication' => 'applications/conduit/application/PhabricatorConduitApplication.php', 'PhabricatorConduitCertificateToken' => 'applications/conduit/storage/PhabricatorConduitCertificateToken.php', - 'PhabricatorConduitConfigOptions' => 'applications/conduit/config/PhabricatorConduitConfigOptions.php', 'PhabricatorConduitConnectionLog' => 'applications/conduit/storage/PhabricatorConduitConnectionLog.php', 'PhabricatorConduitConsoleController' => 'applications/conduit/controller/PhabricatorConduitConsoleController.php', 'PhabricatorConduitController' => 'applications/conduit/controller/PhabricatorConduitController.php', @@ -4530,7 +4529,6 @@ phutil_register_library_map(array( 'PhabricatorConduitAPIController' => 'PhabricatorConduitController', 'PhabricatorConduitApplication' => 'PhabricatorApplication', 'PhabricatorConduitCertificateToken' => 'PhabricatorConduitDAO', - 'PhabricatorConduitConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorConduitConnectionLog' => 'PhabricatorConduitDAO', 'PhabricatorConduitConsoleController' => 'PhabricatorConduitController', 'PhabricatorConduitController' => 'PhabricatorController', diff --git a/src/aphront/configuration/AphrontApplicationConfiguration.php b/src/aphront/configuration/AphrontApplicationConfiguration.php index 8afba8aad8..cffd2e4d99 100644 --- a/src/aphront/configuration/AphrontApplicationConfiguration.php +++ b/src/aphront/configuration/AphrontApplicationConfiguration.php @@ -107,7 +107,6 @@ abstract class AphrontApplicationConfiguration { $prod_uri = PhabricatorEnv::getEnvConfig('phabricator.production-uri'); $file_uri = PhabricatorEnv::getEnvConfig( 'security.alternate-file-domain'); - $conduit_uris = PhabricatorEnv::getEnvConfig('conduit.servers'); $allowed_uris = PhabricatorEnv::getEnvConfig('phabricator.allowed-uris'); $uris = array_merge( @@ -115,7 +114,6 @@ abstract class AphrontApplicationConfiguration { $base_uri, $prod_uri, ), - $conduit_uris, $allowed_uris); $cdn_routes = array( diff --git a/src/applications/conduit/call/ConduitCall.php b/src/applications/conduit/call/ConduitCall.php index 955b91ac50..bbeeaab071 100644 --- a/src/applications/conduit/call/ConduitCall.php +++ b/src/applications/conduit/call/ConduitCall.php @@ -13,14 +13,10 @@ final class ConduitCall { private $method; private $request; private $user; - private $servers; - private $forceLocal; public function __construct($method, array $params) { $this->method = $method; $this->handler = $this->buildMethodHandler($method); - $this->servers = PhabricatorEnv::getEnvConfig('conduit.servers'); - $this->forceLocal = false; $invalid_params = array_diff_key( $params, @@ -31,16 +27,6 @@ final class ConduitCall { implode("', '", array_keys($invalid_params))."'."); } - if ($this->servers) { - $current_host = AphrontRequest::getHTTPHeader('HOST'); - foreach ($this->servers as $server) { - if ($current_host === id(new PhutilURI($server))->getDomain()) { - $this->forceLocal = true; - break; - } - } - } - $this->request = new ConduitAPIRequest($params); } @@ -53,15 +39,6 @@ final class ConduitCall { return $this->user; } - public function setForceLocal($force_local) { - $this->forceLocal = $force_local; - return $this; - } - - public function shouldForceLocal() { - return $this->forceLocal; - } - public function shouldRequireAuthentication() { return $this->handler->shouldRequireAuthentication(); } @@ -137,35 +114,7 @@ final class ConduitCall { } } - if (!$this->shouldForceLocal() && $this->servers) { - $server = $this->pickRandomServer($this->servers); - $client = new ConduitClient($server); - $params = $this->request->getAllParameters(); - - $params['__conduit__']['isProxied'] = true; - - if ($this->handler->shouldRequireAuthentication()) { - $client->callMethodSynchronous( - 'conduit.connect', - array( - 'client' => 'PhabricatorConduit', - 'clientVersion' => '1.0', - 'user' => $this->getUser()->getUserName(), - 'certificate' => $this->getUser()->getConduitCertificate(), - '__conduit__' => $params['__conduit__'], - )); - } - - return $client->callMethodSynchronous( - $this->method, - $params); - } else { - return $this->handler->executeMethod($this->request); - } - } - - protected function pickRandomServer($servers) { - return $servers[array_rand($servers)]; + return $this->handler->executeMethod($this->request); } protected function buildMethodHandler($method_name) { diff --git a/src/applications/conduit/call/__tests__/ConduitCallTestCase.php b/src/applications/conduit/call/__tests__/ConduitCallTestCase.php index d622e0d008..a5cc190d68 100644 --- a/src/applications/conduit/call/__tests__/ConduitCallTestCase.php +++ b/src/applications/conduit/call/__tests__/ConduitCallTestCase.php @@ -4,7 +4,6 @@ final class ConduitCallTestCase extends PhabricatorTestCase { public function testConduitPing() { $call = new ConduitCall('conduit.ping', array()); - $call->setForceLocal(true); $result = $call->execute(); $this->assertFalse(empty($result)); @@ -12,7 +11,6 @@ final class ConduitCallTestCase extends PhabricatorTestCase { public function testConduitAuth() { $call = new ConduitCall('user.whoami', array(), true); - $call->setForceLocal(true); $caught = null; try { diff --git a/src/applications/conduit/config/PhabricatorConduitConfigOptions.php b/src/applications/conduit/config/PhabricatorConduitConfigOptions.php deleted file mode 100644 index 3f9fd2d5d5..0000000000 --- a/src/applications/conduit/config/PhabricatorConduitConfigOptions.php +++ /dev/null @@ -1,31 +0,0 @@ -newOption('conduit.servers', 'list', array()) - ->setLocked(true) - ->setSummary(pht('Servers that conduit can connect to.')) - ->setDescription( - pht( - "Set an array of servers where conduit can connect to. This is ". - "an advanced option. Don't touch this unless you know what you ". - "are doing.")) - ->addExample( - '["http://phabricator2.example.com/", '. - '"http://phabricator3.example.com/]"', - pht('Valid Setting')), - ); - } - -}