Differential D25040 Diff 97 src/applications/almanac/management/AlmanacManagementRegisterWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/almanac/management/AlmanacManagementRegisterWorkflow.php
Show First 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | $public_key = id(new PhabricatorAuthSSHKeyQuery()) | ||||
->setViewer($this->getViewer()) | ->setViewer($this->getViewer()) | ||||
->withKeys(array($key_object)) | ->withKeys(array($key_object)) | ||||
->withIsActive(true) | ->withIsActive(true) | ||||
->executeOne(); | ->executeOne(); | ||||
if (!$public_key) { | if (!$public_key) { | ||||
throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
pht( | pht( | ||||
'The public key corresponding to the given private key is not '. | 'The public key corresponding to the given private key is unknown. '. | ||||
'yet known to Phabricator. Associate the public key with an '. | 'Associate the public key with an Almanac device in the web '. | ||||
'Almanac device in the web interface before registering hosts '. | 'interface before registering hosts with it.')); | ||||
'with it.')); | |||||
} | } | ||||
if ($public_key->getObjectPHID() !== $device->getPHID()) { | if ($public_key->getObjectPHID() !== $device->getPHID()) { | ||||
$public_phid = $public_key->getObjectPHID(); | $public_phid = $public_key->getObjectPHID(); | ||||
$public_handles = $viewer->loadHandles(array($public_phid)); | $public_handles = $viewer->loadHandles(array($public_phid)); | ||||
$public_handle = $public_handles[$public_phid]; | $public_handle = $public_handles[$public_phid]; | ||||
throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0