@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Check to make sure credential is not null in SSH command interface

Summary: This adds a check to make sure the credential exists when loading it in the Drydock SSH interface. This effectively turns a fatal error (calling a method on a non-object) into a catchable exception.

Test Plan: Had a badly configured resource, saw the exception appear instead of daemon fataling.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11530

+6
+6
src/applications/drydock/interface/command/DrydockSSHCommandInterface.php
··· 16 16 ->needSecrets(true) 17 17 ->executeOne(); 18 18 19 + if ($credential === null) { 20 + throw new Exception(pht( 21 + 'There is no credential with ID %d.', 22 + $this->getConfig('credential'))); 23 + } 24 + 19 25 if ($credential->getProvidesType() !== 20 26 PassphraseCredentialTypeSSHPrivateKey::PROVIDES_TYPE) { 21 27 throw new Exception('Only private key credentials are supported.');