Changeset View
Changeset View
Standalone View
Standalone View
scripts/arcanist.php
| Show First 20 Lines • Show All 269 Lines • ▼ Show 20 Lines | if ($need_conduit) { | ||||
| } | } | ||||
| $workflow->establishConduit(); | $workflow->establishConduit(); | ||||
| } | } | ||||
| $hosts_config = idx($user_config, 'hosts', array()); | $hosts_config = idx($user_config, 'hosts', array()); | ||||
| $host_config = idx($hosts_config, $conduit_uri, array()); | $host_config = idx($hosts_config, $conduit_uri, array()); | ||||
| $user_name = idx($host_config, 'user'); | $user_name = idx($host_config, 'user'); | ||||
| $certificate = idx($host_config, 'cert'); | $certificate = idx($host_config, 'cert'); | ||||
| $conduit_token = idx($host_config, 'token'); | |||||
| $description = implode(' ', $original_argv); | $description = implode(' ', $original_argv); | ||||
| $credentials = array( | $credentials = array( | ||||
| 'user' => $user_name, | 'user' => $user_name, | ||||
| 'certificate' => $certificate, | 'certificate' => $certificate, | ||||
| 'description' => $description, | 'description' => $description, | ||||
| 'token' => $conduit_token, | |||||
| ); | ); | ||||
| $workflow->setConduitCredentials($credentials); | $workflow->setConduitCredentials($credentials); | ||||
| if ($need_auth) { | if ($need_auth) { | ||||
| if (!$user_name || !$certificate) { | if ((!$user_name || !$certificate) && (!$conduit_token)) { | ||||
| $arc = 'arc'; | $arc = 'arc'; | ||||
| if ($force_conduit) { | if ($force_conduit) { | ||||
| $arc .= csprintf(' --conduit-uri=%s', $conduit_uri); | $arc .= csprintf(' --conduit-uri=%s', $conduit_uri); | ||||
| } | } | ||||
| $conduit_domain = id(new PhutilURI($conduit_uri))->getDomain(); | |||||
| throw new ArcanistUsageException( | throw new ArcanistUsageException( | ||||
| phutil_console_format( | phutil_console_format( | ||||
| "YOU NEED TO __INSTALL A CERTIFICATE__ TO LOGIN TO PHABRICATOR\n\n". | "YOU NEED TO AUTHENTICATE TO CONTINUE\n\n". | ||||
| "You are trying to connect to '{$conduit_uri}' but do not have ". | "You are trying to connect to a server ({$conduit_domain}) that you ". | ||||
| "a certificate installed for this host. Run:\n\n". | "do not have any credentials stored for.\n\n". | ||||
| " $ **{$arc} install-certificate**\n\n". | "To retrieve and store credentials for this server, ". | ||||
| "...to install one.")); | "**run this command:**\n\n". | ||||
| " $ **{$arc} install-certificate**\n")); | |||||
| } | } | ||||
| $workflow->authenticateConduit(); | $workflow->authenticateConduit(); | ||||
| } | } | ||||
| if ($need_repository_api || | if ($need_repository_api || | ||||
| ($want_repository_api && $working_copy->getVCSType())) { | ($want_repository_api && $working_copy->getVCSType())) { | ||||
| $repository_api = ArcanistRepositoryAPI::newAPIFromConfigurationManager( | $repository_api = ArcanistRepositoryAPI::newAPIFromConfigurationManager( | ||||
| $configuration_manager); | $configuration_manager); | ||||
| ▲ Show 20 Lines • Show All 344 Lines • Show Last 20 Lines | |||||