@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.

Rename PassphraseCredentialType subclasses for consistency

Summary: Ref T5655.

Test Plan: `arc unit` + `grep`

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5655

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

+42 -41
+3 -3
resources/sql/patches/20131121.repocredentials.2.mig.php
··· 26 26 if ($proto == 'http' || $proto == 'https' || $proto == 'svn') { 27 27 $username = $repository->getDetail('http-login'); 28 28 $secret = $repository->getDetail('http-pass'); 29 - $type = PassphraseCredentialTypePassword::CREDENTIAL_TYPE; 29 + $type = PassphrasePasswordCredentialType::CREDENTIAL_TYPE; 30 30 } else { 31 31 $username = $repository->getDetail('ssh-login'); 32 32 if (!$username) { ··· 42 42 $file = $repository->getDetail('ssh-keyfile'); 43 43 if ($file) { 44 44 $secret = $file; 45 - $type = PassphraseCredentialTypeSSHPrivateKeyFile::CREDENTIAL_TYPE; 45 + $type = PassphraseSSHPrivateKeyFileCredentialType::CREDENTIAL_TYPE; 46 46 } else { 47 47 $secret = $repository->getDetail('ssh-key'); 48 - $type = PassphraseCredentialTypeSSHPrivateKeyText::CREDENTIAL_TYPE; 48 + $type = PassphraseSSHPrivateKeyTextCredentialType::CREDENTIAL_TYPE; 49 49 } 50 50 } 51 51
+11 -10
src/__phutil_library_map__.php
··· 1260 1260 'PassphraseCredentialTransactionEditor' => 'applications/passphrase/editor/PassphraseCredentialTransactionEditor.php', 1261 1261 'PassphraseCredentialTransactionQuery' => 'applications/passphrase/query/PassphraseCredentialTransactionQuery.php', 1262 1262 'PassphraseCredentialType' => 'applications/passphrase/credentialtype/PassphraseCredentialType.php', 1263 - 'PassphraseCredentialTypePassword' => 'applications/passphrase/credentialtype/PassphraseCredentialTypePassword.php', 1264 - 'PassphraseCredentialTypeSSHGeneratedKey' => 'applications/passphrase/credentialtype/PassphraseCredentialTypeSSHGeneratedKey.php', 1265 - 'PassphraseCredentialTypeSSHPrivateKey' => 'applications/passphrase/credentialtype/PassphraseCredentialTypeSSHPrivateKey.php', 1266 - 'PassphraseCredentialTypeSSHPrivateKeyFile' => 'applications/passphrase/credentialtype/PassphraseCredentialTypeSSHPrivateKeyFile.php', 1267 - 'PassphraseCredentialTypeSSHPrivateKeyText' => 'applications/passphrase/credentialtype/PassphraseCredentialTypeSSHPrivateKeyText.php', 1268 1263 'PassphraseCredentialViewController' => 'applications/passphrase/controller/PassphraseCredentialViewController.php', 1269 1264 'PassphraseDAO' => 'applications/passphrase/storage/PassphraseDAO.php', 1265 + 'PassphrasePasswordCredentialType' => 'applications/passphrase/credentialtype/PassphrasePasswordCredentialType.php', 1270 1266 'PassphrasePasswordKey' => 'applications/passphrase/keys/PassphrasePasswordKey.php', 1271 1267 'PassphraseQueryConduitAPIMethod' => 'applications/passphrase/conduit/PassphraseQueryConduitAPIMethod.php', 1272 1268 'PassphraseRemarkupRule' => 'applications/passphrase/remarkup/PassphraseRemarkupRule.php', 1269 + 'PassphraseSSHGeneratedKeyCredentialType' => 'applications/passphrase/credentialtype/PassphraseSSHGeneratedKeyCredentialType.php', 1273 1270 'PassphraseSSHKey' => 'applications/passphrase/keys/PassphraseSSHKey.php', 1271 + 'PassphraseSSHPrivateKeyCredentialType' => 'applications/passphrase/credentialtype/PassphraseSSHPrivateKeyCredentialType.php', 1272 + 'PassphraseSSHPrivateKeyFileCredentialType' => 'applications/passphrase/credentialtype/PassphraseSSHPrivateKeyFileCredentialType.php', 1273 + 'PassphraseSSHPrivateKeyTextCredentialType' => 'applications/passphrase/credentialtype/PassphraseSSHPrivateKeyTextCredentialType.php', 1274 1274 'PassphraseSchemaSpec' => 'applications/passphrase/storage/PassphraseSchemaSpec.php', 1275 1275 'PassphraseSearchIndexer' => 'applications/passphrase/search/PassphraseSearchIndexer.php', 1276 1276 'PassphraseSecret' => 'applications/passphrase/storage/PassphraseSecret.php', ··· 3933 3933 'DivinerDAO', 3934 3934 'PhabricatorPolicyInterface', 3935 3935 'PhabricatorDestructibleInterface', 3936 + 'PhabricatorApplicationTransactionInterface', 3936 3937 ), 3937 3938 'DivinerLivePublisher' => 'DivinerPublisher', 3938 3939 'DivinerLiveSymbol' => array( ··· 4641 4642 'PassphraseCredentialTransactionEditor' => 'PhabricatorApplicationTransactionEditor', 4642 4643 'PassphraseCredentialTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 4643 4644 'PassphraseCredentialType' => 'Phobject', 4644 - 'PassphraseCredentialTypePassword' => 'PassphraseCredentialType', 4645 - 'PassphraseCredentialTypeSSHGeneratedKey' => 'PassphraseCredentialTypeSSHPrivateKey', 4646 - 'PassphraseCredentialTypeSSHPrivateKey' => 'PassphraseCredentialType', 4647 - 'PassphraseCredentialTypeSSHPrivateKeyFile' => 'PassphraseCredentialTypeSSHPrivateKey', 4648 - 'PassphraseCredentialTypeSSHPrivateKeyText' => 'PassphraseCredentialTypeSSHPrivateKey', 4649 4645 'PassphraseCredentialViewController' => 'PassphraseController', 4650 4646 'PassphraseDAO' => 'PhabricatorLiskDAO', 4647 + 'PassphrasePasswordCredentialType' => 'PassphraseCredentialType', 4651 4648 'PassphrasePasswordKey' => 'PassphraseAbstractKey', 4652 4649 'PassphraseQueryConduitAPIMethod' => 'PassphraseConduitAPIMethod', 4653 4650 'PassphraseRemarkupRule' => 'PhabricatorObjectRemarkupRule', 4651 + 'PassphraseSSHGeneratedKeyCredentialType' => 'PassphraseSSHPrivateKeyCredentialType', 4654 4652 'PassphraseSSHKey' => 'PassphraseAbstractKey', 4653 + 'PassphraseSSHPrivateKeyCredentialType' => 'PassphraseCredentialType', 4654 + 'PassphraseSSHPrivateKeyFileCredentialType' => 'PassphraseSSHPrivateKeyCredentialType', 4655 + 'PassphraseSSHPrivateKeyTextCredentialType' => 'PassphraseSSHPrivateKeyCredentialType', 4655 4656 'PassphraseSchemaSpec' => 'PhabricatorConfigSchemaSpec', 4656 4657 'PassphraseSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 4657 4658 'PassphraseSecret' => 'PassphraseDAO',
+6 -6
src/applications/diffusion/controller/DiffusionRepositoryCreateController.php
··· 591 591 if ($this->isSSHProtocol($proto)) { 592 592 $c_credential->setLabel(pht('SSH Key')); 593 593 $c_credential->setCredentialType( 594 - PassphraseCredentialTypeSSHPrivateKeyText::CREDENTIAL_TYPE); 595 - $provides_type = PassphraseCredentialTypeSSHPrivateKey::PROVIDES_TYPE; 594 + PassphraseSSHPrivateKeyTextCredentialType::CREDENTIAL_TYPE); 595 + $provides_type = PassphraseSSHPrivateKeyCredentialType::PROVIDES_TYPE; 596 596 597 597 $page->addRemarkupInstructions( 598 598 pht( ··· 607 607 $c_credential->setLabel(pht('Password')); 608 608 $c_credential->setAllowNull(true); 609 609 $c_credential->setCredentialType( 610 - PassphraseCredentialTypePassword::CREDENTIAL_TYPE); 611 - $provides_type = PassphraseCredentialTypePassword::PROVIDES_TYPE; 610 + PassphrasePasswordCredentialType::CREDENTIAL_TYPE); 611 + $provides_type = PassphrasePasswordCredentialType::PROVIDES_TYPE; 612 612 613 613 $page->addRemarkupInstructions( 614 614 pht( ··· 663 663 pht('You must choose an SSH credential to connect over SSH.')); 664 664 } 665 665 666 - $ssh_type = PassphraseCredentialTypeSSHPrivateKey::PROVIDES_TYPE; 666 + $ssh_type = PassphraseSSHPrivateKeyCredentialType::PROVIDES_TYPE; 667 667 if ($credential->getProvidesType() !== $ssh_type) { 668 668 $c_credential->setError(pht('Invalid')); 669 669 $page->addPageError( ··· 674 674 675 675 } else if ($this->isUsernamePasswordProtocol($proto)) { 676 676 if ($credential) { 677 - $password_type = PassphraseCredentialTypePassword::PROVIDES_TYPE; 677 + $password_type = PassphrasePasswordCredentialType::PROVIDES_TYPE; 678 678 if ($credential->getProvidesType() !== $password_type) { 679 679 $c_credential->setError(pht('Invalid')); 680 680 $page->addPageError(
+1 -1
src/applications/drydock/interface/command/DrydockSSHCommandInterface.php
··· 24 24 } 25 25 26 26 if ($credential->getProvidesType() !== 27 - PassphraseCredentialTypeSSHPrivateKey::PROVIDES_TYPE) { 27 + PassphraseSSHPrivateKeyCredentialType::PROVIDES_TYPE) { 28 28 throw new Exception(pht('Only private key credentials are supported.')); 29 29 } 30 30
+1 -1
src/applications/drydock/interface/filesystem/DrydockSFTPFilesystemInterface.php
··· 16 16 ->executeOne(); 17 17 18 18 if ($credential->getProvidesType() !== 19 - PassphraseCredentialTypeSSHPrivateKey::PROVIDES_TYPE) { 19 + PassphraseSSHPrivateKeyCredentialType::PROVIDES_TYPE) { 20 20 throw new Exception(pht('Only private key credentials are supported.')); 21 21 } 22 22
+2 -2
src/applications/harbormaster/step/HarbormasterHTTPRequestBuildStepImplementation.php
··· 95 95 'name' => pht('Credentials'), 96 96 'type' => 'credential', 97 97 'credential.type' 98 - => PassphraseCredentialTypePassword::CREDENTIAL_TYPE, 98 + => PassphrasePasswordCredentialType::CREDENTIAL_TYPE, 99 99 'credential.provides' 100 - => PassphraseCredentialTypePassword::PROVIDES_TYPE, 100 + => PassphrasePasswordCredentialType::PROVIDES_TYPE, 101 101 ), 102 102 ); 103 103 }
+4 -4
src/applications/passphrase/conduit/PassphraseQueryConduitAPIMethod.php
··· 78 78 } 79 79 80 80 switch ($credential->getCredentialType()) { 81 - case PassphraseCredentialTypeSSHPrivateKeyFile::CREDENTIAL_TYPE: 81 + case PassphraseSSHPrivateKeyFileCredentialType::CREDENTIAL_TYPE: 82 82 if ($secret) { 83 83 $material['file'] = $secret; 84 84 } ··· 86 86 $material['publicKey'] = $public_key; 87 87 } 88 88 break; 89 - case PassphraseCredentialTypeSSHGeneratedKey::CREDENTIAL_TYPE: 90 - case PassphraseCredentialTypeSSHPrivateKeyText::CREDENTIAL_TYPE: 89 + case PassphraseSSHGeneratedKeyCredentialType::CREDENTIAL_TYPE: 90 + case PassphraseSSHPrivateKeyTextCredentialType::CREDENTIAL_TYPE: 91 91 if ($secret) { 92 92 $material['privateKey'] = $secret; 93 93 } ··· 95 95 $material['publicKey'] = $public_key; 96 96 } 97 97 break; 98 - case PassphraseCredentialTypePassword::CREDENTIAL_TYPE: 98 + case PassphrasePasswordCredentialType::CREDENTIAL_TYPE: 99 99 if ($secret) { 100 100 $material['password'] = $secret; 101 101 }
+1 -1
src/applications/passphrase/credentialtype/PassphraseCredentialTypePassword.php src/applications/passphrase/credentialtype/PassphrasePasswordCredentialType.php
··· 1 1 <?php 2 2 3 - final class PassphraseCredentialTypePassword 3 + final class PassphrasePasswordCredentialType 4 4 extends PassphraseCredentialType { 5 5 6 6 const CREDENTIAL_TYPE = 'password';
+2 -2
src/applications/passphrase/credentialtype/PassphraseCredentialTypeSSHGeneratedKey.php src/applications/passphrase/credentialtype/PassphraseSSHGeneratedKeyCredentialType.php
··· 1 1 <?php 2 2 3 - final class PassphraseCredentialTypeSSHGeneratedKey 4 - extends PassphraseCredentialTypeSSHPrivateKey { 3 + final class PassphraseSSHGeneratedKeyCredentialType 4 + extends PassphraseSSHPrivateKeyCredentialType { 5 5 6 6 const CREDENTIAL_TYPE = 'ssh-generated-key'; 7 7
+1 -1
src/applications/passphrase/credentialtype/PassphraseCredentialTypeSSHPrivateKey.php src/applications/passphrase/credentialtype/PassphraseSSHPrivateKeyCredentialType.php
··· 1 1 <?php 2 2 3 - abstract class PassphraseCredentialTypeSSHPrivateKey 3 + abstract class PassphraseSSHPrivateKeyCredentialType 4 4 extends PassphraseCredentialType { 5 5 6 6 const PROVIDES_TYPE = 'provides/ssh-key-file';
+2 -2
src/applications/passphrase/credentialtype/PassphraseCredentialTypeSSHPrivateKeyFile.php src/applications/passphrase/credentialtype/PassphraseSSHPrivateKeyFileCredentialType.php
··· 1 1 <?php 2 2 3 - final class PassphraseCredentialTypeSSHPrivateKeyFile 4 - extends PassphraseCredentialTypeSSHPrivateKey { 3 + final class PassphraseSSHPrivateKeyFileCredentialType 4 + extends PassphraseSSHPrivateKeyCredentialType { 5 5 6 6 const CREDENTIAL_TYPE = 'ssh-key-file'; 7 7
+2 -2
src/applications/passphrase/credentialtype/PassphraseCredentialTypeSSHPrivateKeyText.php src/applications/passphrase/credentialtype/PassphraseSSHPrivateKeyTextCredentialType.php
··· 1 1 <?php 2 2 3 - final class PassphraseCredentialTypeSSHPrivateKeyText 4 - extends PassphraseCredentialTypeSSHPrivateKey { 3 + final class PassphraseSSHPrivateKeyTextCredentialType 4 + extends PassphraseSSHPrivateKeyCredentialType { 5 5 6 6 const CREDENTIAL_TYPE = 'ssh-key-text'; 7 7
+1 -1
src/applications/passphrase/keys/PassphrasePasswordKey.php
··· 7 7 return $key->loadAndValidateFromPHID( 8 8 $phid, 9 9 $viewer, 10 - PassphraseCredentialTypePassword::PROVIDES_TYPE); 10 + PassphrasePasswordCredentialType::PROVIDES_TYPE); 11 11 } 12 12 13 13 public function getPasswordEnvelope() {
+2 -2
src/applications/passphrase/keys/PassphraseSSHKey.php
··· 9 9 return $key->loadAndValidateFromPHID( 10 10 $phid, 11 11 $viewer, 12 - PassphraseCredentialTypeSSHPrivateKey::PROVIDES_TYPE); 12 + PassphraseSSHPrivateKeyCredentialType::PROVIDES_TYPE); 13 13 } 14 14 15 15 public function getKeyfileEnvelope() { 16 16 $credential = $this->requireCredential(); 17 17 18 - $file_type = PassphraseCredentialTypeSSHPrivateKeyFile::CREDENTIAL_TYPE; 18 + $file_type = PassphraseSSHPrivateKeyFileCredentialType::CREDENTIAL_TYPE; 19 19 if ($credential->getCredentialType() != $file_type) { 20 20 // If the credential does not store a file, write the key text out to a 21 21 // temporary file so we can pass it to `ssh`.
+2 -2
src/applications/repository/storage/__tests__/PhabricatorRepositoryURITestCase.php
··· 19 19 $http_secret = id(new PassphraseSecret())->setSecretData('quack')->save(); 20 20 21 21 $http_credential = PassphraseCredential::initializeNewCredential($user) 22 - ->setCredentialType(PassphraseCredentialTypePassword::CREDENTIAL_TYPE) 23 - ->setProvidesType(PassphraseCredentialTypePassword::PROVIDES_TYPE) 22 + ->setCredentialType(PassphrasePasswordCredentialType::CREDENTIAL_TYPE) 23 + ->setProvidesType(PassphrasePasswordCredentialType::PROVIDES_TYPE) 24 24 ->setUsername('duck') 25 25 ->setSecretID($http_secret->getID()) 26 26 ->save();
+1 -1
src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldCredential.php
··· 24 24 25 25 $all_types = PassphraseCredentialType::getAllProvidesTypes(); 26 26 if (!in_array($provides_type, $all_types)) { 27 - $provides_type = PassphraseCredentialTypePassword::PROVIDES_TYPE; 27 + $provides_type = PassphrasePasswordCredentialType::PROVIDES_TYPE; 28 28 } 29 29 30 30 $credentials = id(new PassphraseCredentialQuery())