diff --git a/resources/sql/patches/20131121.repocredentials.2.mig.php b/resources/sql/patches/20131121.repocredentials.2.mig.php index 3953b8416f..3da813408f 100644 --- a/resources/sql/patches/20131121.repocredentials.2.mig.php +++ b/resources/sql/patches/20131121.repocredentials.2.mig.php @@ -26,7 +26,7 @@ foreach (new LiskMigrationIterator($table) as $repository) { if ($proto == 'http' || $proto == 'https' || $proto == 'svn') { $username = $repository->getDetail('http-login'); $secret = $repository->getDetail('http-pass'); - $type = PassphraseCredentialTypePassword::CREDENTIAL_TYPE; + $type = PassphrasePasswordCredentialType::CREDENTIAL_TYPE; } else { $username = $repository->getDetail('ssh-login'); if (!$username) { @@ -42,10 +42,10 @@ foreach (new LiskMigrationIterator($table) as $repository) { $file = $repository->getDetail('ssh-keyfile'); if ($file) { $secret = $file; - $type = PassphraseCredentialTypeSSHPrivateKeyFile::CREDENTIAL_TYPE; + $type = PassphraseSSHPrivateKeyFileCredentialType::CREDENTIAL_TYPE; } else { $secret = $repository->getDetail('ssh-key'); - $type = PassphraseCredentialTypeSSHPrivateKeyText::CREDENTIAL_TYPE; + $type = PassphraseSSHPrivateKeyTextCredentialType::CREDENTIAL_TYPE; } } diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 530101ae40..dea33f4aa2 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1260,17 +1260,17 @@ phutil_register_library_map(array( 'PassphraseCredentialTransactionEditor' => 'applications/passphrase/editor/PassphraseCredentialTransactionEditor.php', 'PassphraseCredentialTransactionQuery' => 'applications/passphrase/query/PassphraseCredentialTransactionQuery.php', 'PassphraseCredentialType' => 'applications/passphrase/credentialtype/PassphraseCredentialType.php', - 'PassphraseCredentialTypePassword' => 'applications/passphrase/credentialtype/PassphraseCredentialTypePassword.php', - 'PassphraseCredentialTypeSSHGeneratedKey' => 'applications/passphrase/credentialtype/PassphraseCredentialTypeSSHGeneratedKey.php', - 'PassphraseCredentialTypeSSHPrivateKey' => 'applications/passphrase/credentialtype/PassphraseCredentialTypeSSHPrivateKey.php', - 'PassphraseCredentialTypeSSHPrivateKeyFile' => 'applications/passphrase/credentialtype/PassphraseCredentialTypeSSHPrivateKeyFile.php', - 'PassphraseCredentialTypeSSHPrivateKeyText' => 'applications/passphrase/credentialtype/PassphraseCredentialTypeSSHPrivateKeyText.php', 'PassphraseCredentialViewController' => 'applications/passphrase/controller/PassphraseCredentialViewController.php', 'PassphraseDAO' => 'applications/passphrase/storage/PassphraseDAO.php', + 'PassphrasePasswordCredentialType' => 'applications/passphrase/credentialtype/PassphrasePasswordCredentialType.php', 'PassphrasePasswordKey' => 'applications/passphrase/keys/PassphrasePasswordKey.php', 'PassphraseQueryConduitAPIMethod' => 'applications/passphrase/conduit/PassphraseQueryConduitAPIMethod.php', 'PassphraseRemarkupRule' => 'applications/passphrase/remarkup/PassphraseRemarkupRule.php', + 'PassphraseSSHGeneratedKeyCredentialType' => 'applications/passphrase/credentialtype/PassphraseSSHGeneratedKeyCredentialType.php', 'PassphraseSSHKey' => 'applications/passphrase/keys/PassphraseSSHKey.php', + 'PassphraseSSHPrivateKeyCredentialType' => 'applications/passphrase/credentialtype/PassphraseSSHPrivateKeyCredentialType.php', + 'PassphraseSSHPrivateKeyFileCredentialType' => 'applications/passphrase/credentialtype/PassphraseSSHPrivateKeyFileCredentialType.php', + 'PassphraseSSHPrivateKeyTextCredentialType' => 'applications/passphrase/credentialtype/PassphraseSSHPrivateKeyTextCredentialType.php', 'PassphraseSchemaSpec' => 'applications/passphrase/storage/PassphraseSchemaSpec.php', 'PassphraseSearchIndexer' => 'applications/passphrase/search/PassphraseSearchIndexer.php', 'PassphraseSecret' => 'applications/passphrase/storage/PassphraseSecret.php', @@ -3933,6 +3933,7 @@ phutil_register_library_map(array( 'DivinerDAO', 'PhabricatorPolicyInterface', 'PhabricatorDestructibleInterface', + 'PhabricatorApplicationTransactionInterface', ), 'DivinerLivePublisher' => 'DivinerPublisher', 'DivinerLiveSymbol' => array( @@ -4641,17 +4642,17 @@ phutil_register_library_map(array( 'PassphraseCredentialTransactionEditor' => 'PhabricatorApplicationTransactionEditor', 'PassphraseCredentialTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 'PassphraseCredentialType' => 'Phobject', - 'PassphraseCredentialTypePassword' => 'PassphraseCredentialType', - 'PassphraseCredentialTypeSSHGeneratedKey' => 'PassphraseCredentialTypeSSHPrivateKey', - 'PassphraseCredentialTypeSSHPrivateKey' => 'PassphraseCredentialType', - 'PassphraseCredentialTypeSSHPrivateKeyFile' => 'PassphraseCredentialTypeSSHPrivateKey', - 'PassphraseCredentialTypeSSHPrivateKeyText' => 'PassphraseCredentialTypeSSHPrivateKey', 'PassphraseCredentialViewController' => 'PassphraseController', 'PassphraseDAO' => 'PhabricatorLiskDAO', + 'PassphrasePasswordCredentialType' => 'PassphraseCredentialType', 'PassphrasePasswordKey' => 'PassphraseAbstractKey', 'PassphraseQueryConduitAPIMethod' => 'PassphraseConduitAPIMethod', 'PassphraseRemarkupRule' => 'PhabricatorObjectRemarkupRule', + 'PassphraseSSHGeneratedKeyCredentialType' => 'PassphraseSSHPrivateKeyCredentialType', 'PassphraseSSHKey' => 'PassphraseAbstractKey', + 'PassphraseSSHPrivateKeyCredentialType' => 'PassphraseCredentialType', + 'PassphraseSSHPrivateKeyFileCredentialType' => 'PassphraseSSHPrivateKeyCredentialType', + 'PassphraseSSHPrivateKeyTextCredentialType' => 'PassphraseSSHPrivateKeyCredentialType', 'PassphraseSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PassphraseSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 'PassphraseSecret' => 'PassphraseDAO', diff --git a/src/applications/diffusion/controller/DiffusionRepositoryCreateController.php b/src/applications/diffusion/controller/DiffusionRepositoryCreateController.php index 269523915e..9b6f4eee63 100644 --- a/src/applications/diffusion/controller/DiffusionRepositoryCreateController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryCreateController.php @@ -591,8 +591,8 @@ final class DiffusionRepositoryCreateController if ($this->isSSHProtocol($proto)) { $c_credential->setLabel(pht('SSH Key')); $c_credential->setCredentialType( - PassphraseCredentialTypeSSHPrivateKeyText::CREDENTIAL_TYPE); - $provides_type = PassphraseCredentialTypeSSHPrivateKey::PROVIDES_TYPE; + PassphraseSSHPrivateKeyTextCredentialType::CREDENTIAL_TYPE); + $provides_type = PassphraseSSHPrivateKeyCredentialType::PROVIDES_TYPE; $page->addRemarkupInstructions( pht( @@ -607,8 +607,8 @@ final class DiffusionRepositoryCreateController $c_credential->setLabel(pht('Password')); $c_credential->setAllowNull(true); $c_credential->setCredentialType( - PassphraseCredentialTypePassword::CREDENTIAL_TYPE); - $provides_type = PassphraseCredentialTypePassword::PROVIDES_TYPE; + PassphrasePasswordCredentialType::CREDENTIAL_TYPE); + $provides_type = PassphrasePasswordCredentialType::PROVIDES_TYPE; $page->addRemarkupInstructions( pht( @@ -663,7 +663,7 @@ final class DiffusionRepositoryCreateController pht('You must choose an SSH credential to connect over SSH.')); } - $ssh_type = PassphraseCredentialTypeSSHPrivateKey::PROVIDES_TYPE; + $ssh_type = PassphraseSSHPrivateKeyCredentialType::PROVIDES_TYPE; if ($credential->getProvidesType() !== $ssh_type) { $c_credential->setError(pht('Invalid')); $page->addPageError( @@ -674,7 +674,7 @@ final class DiffusionRepositoryCreateController } else if ($this->isUsernamePasswordProtocol($proto)) { if ($credential) { - $password_type = PassphraseCredentialTypePassword::PROVIDES_TYPE; + $password_type = PassphrasePasswordCredentialType::PROVIDES_TYPE; if ($credential->getProvidesType() !== $password_type) { $c_credential->setError(pht('Invalid')); $page->addPageError( diff --git a/src/applications/drydock/interface/command/DrydockSSHCommandInterface.php b/src/applications/drydock/interface/command/DrydockSSHCommandInterface.php index e691e0ecff..362e60e3c0 100644 --- a/src/applications/drydock/interface/command/DrydockSSHCommandInterface.php +++ b/src/applications/drydock/interface/command/DrydockSSHCommandInterface.php @@ -24,7 +24,7 @@ final class DrydockSSHCommandInterface extends DrydockCommandInterface { } if ($credential->getProvidesType() !== - PassphraseCredentialTypeSSHPrivateKey::PROVIDES_TYPE) { + PassphraseSSHPrivateKeyCredentialType::PROVIDES_TYPE) { throw new Exception(pht('Only private key credentials are supported.')); } diff --git a/src/applications/drydock/interface/filesystem/DrydockSFTPFilesystemInterface.php b/src/applications/drydock/interface/filesystem/DrydockSFTPFilesystemInterface.php index fe7d2d1cd3..41b126483d 100644 --- a/src/applications/drydock/interface/filesystem/DrydockSFTPFilesystemInterface.php +++ b/src/applications/drydock/interface/filesystem/DrydockSFTPFilesystemInterface.php @@ -16,7 +16,7 @@ final class DrydockSFTPFilesystemInterface extends DrydockFilesystemInterface { ->executeOne(); if ($credential->getProvidesType() !== - PassphraseCredentialTypeSSHPrivateKey::PROVIDES_TYPE) { + PassphraseSSHPrivateKeyCredentialType::PROVIDES_TYPE) { throw new Exception(pht('Only private key credentials are supported.')); } diff --git a/src/applications/harbormaster/step/HarbormasterHTTPRequestBuildStepImplementation.php b/src/applications/harbormaster/step/HarbormasterHTTPRequestBuildStepImplementation.php index dfc29cedc7..5d361b3de3 100644 --- a/src/applications/harbormaster/step/HarbormasterHTTPRequestBuildStepImplementation.php +++ b/src/applications/harbormaster/step/HarbormasterHTTPRequestBuildStepImplementation.php @@ -95,9 +95,9 @@ final class HarbormasterHTTPRequestBuildStepImplementation 'name' => pht('Credentials'), 'type' => 'credential', 'credential.type' - => PassphraseCredentialTypePassword::CREDENTIAL_TYPE, + => PassphrasePasswordCredentialType::CREDENTIAL_TYPE, 'credential.provides' - => PassphraseCredentialTypePassword::PROVIDES_TYPE, + => PassphrasePasswordCredentialType::PROVIDES_TYPE, ), ); } diff --git a/src/applications/passphrase/conduit/PassphraseQueryConduitAPIMethod.php b/src/applications/passphrase/conduit/PassphraseQueryConduitAPIMethod.php index 0163cd5046..18010efd73 100644 --- a/src/applications/passphrase/conduit/PassphraseQueryConduitAPIMethod.php +++ b/src/applications/passphrase/conduit/PassphraseQueryConduitAPIMethod.php @@ -78,7 +78,7 @@ final class PassphraseQueryConduitAPIMethod } switch ($credential->getCredentialType()) { - case PassphraseCredentialTypeSSHPrivateKeyFile::CREDENTIAL_TYPE: + case PassphraseSSHPrivateKeyFileCredentialType::CREDENTIAL_TYPE: if ($secret) { $material['file'] = $secret; } @@ -86,8 +86,8 @@ final class PassphraseQueryConduitAPIMethod $material['publicKey'] = $public_key; } break; - case PassphraseCredentialTypeSSHGeneratedKey::CREDENTIAL_TYPE: - case PassphraseCredentialTypeSSHPrivateKeyText::CREDENTIAL_TYPE: + case PassphraseSSHGeneratedKeyCredentialType::CREDENTIAL_TYPE: + case PassphraseSSHPrivateKeyTextCredentialType::CREDENTIAL_TYPE: if ($secret) { $material['privateKey'] = $secret; } @@ -95,7 +95,7 @@ final class PassphraseQueryConduitAPIMethod $material['publicKey'] = $public_key; } break; - case PassphraseCredentialTypePassword::CREDENTIAL_TYPE: + case PassphrasePasswordCredentialType::CREDENTIAL_TYPE: if ($secret) { $material['password'] = $secret; } diff --git a/src/applications/passphrase/credentialtype/PassphraseCredentialTypePassword.php b/src/applications/passphrase/credentialtype/PassphrasePasswordCredentialType.php similarity index 93% rename from src/applications/passphrase/credentialtype/PassphraseCredentialTypePassword.php rename to src/applications/passphrase/credentialtype/PassphrasePasswordCredentialType.php index bc55f1e4da..695059fd1d 100644 --- a/src/applications/passphrase/credentialtype/PassphraseCredentialTypePassword.php +++ b/src/applications/passphrase/credentialtype/PassphrasePasswordCredentialType.php @@ -1,6 +1,6 @@ loadAndValidateFromPHID( $phid, $viewer, - PassphraseCredentialTypePassword::PROVIDES_TYPE); + PassphrasePasswordCredentialType::PROVIDES_TYPE); } public function getPasswordEnvelope() { diff --git a/src/applications/passphrase/keys/PassphraseSSHKey.php b/src/applications/passphrase/keys/PassphraseSSHKey.php index 0790d5342e..f55eb3be93 100644 --- a/src/applications/passphrase/keys/PassphraseSSHKey.php +++ b/src/applications/passphrase/keys/PassphraseSSHKey.php @@ -9,13 +9,13 @@ final class PassphraseSSHKey extends PassphraseAbstractKey { return $key->loadAndValidateFromPHID( $phid, $viewer, - PassphraseCredentialTypeSSHPrivateKey::PROVIDES_TYPE); + PassphraseSSHPrivateKeyCredentialType::PROVIDES_TYPE); } public function getKeyfileEnvelope() { $credential = $this->requireCredential(); - $file_type = PassphraseCredentialTypeSSHPrivateKeyFile::CREDENTIAL_TYPE; + $file_type = PassphraseSSHPrivateKeyFileCredentialType::CREDENTIAL_TYPE; if ($credential->getCredentialType() != $file_type) { // If the credential does not store a file, write the key text out to a // temporary file so we can pass it to `ssh`. diff --git a/src/applications/repository/storage/__tests__/PhabricatorRepositoryURITestCase.php b/src/applications/repository/storage/__tests__/PhabricatorRepositoryURITestCase.php index d3535102de..0d13cf0e08 100644 --- a/src/applications/repository/storage/__tests__/PhabricatorRepositoryURITestCase.php +++ b/src/applications/repository/storage/__tests__/PhabricatorRepositoryURITestCase.php @@ -19,8 +19,8 @@ final class PhabricatorRepositoryURITestCase $http_secret = id(new PassphraseSecret())->setSecretData('quack')->save(); $http_credential = PassphraseCredential::initializeNewCredential($user) - ->setCredentialType(PassphraseCredentialTypePassword::CREDENTIAL_TYPE) - ->setProvidesType(PassphraseCredentialTypePassword::PROVIDES_TYPE) + ->setCredentialType(PassphrasePasswordCredentialType::CREDENTIAL_TYPE) + ->setProvidesType(PassphrasePasswordCredentialType::PROVIDES_TYPE) ->setUsername('duck') ->setSecretID($http_secret->getID()) ->save(); diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldCredential.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldCredential.php index 94fbe165a4..d842ef3d17 100644 --- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldCredential.php +++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldCredential.php @@ -24,7 +24,7 @@ final class PhabricatorStandardCustomFieldCredential $all_types = PassphraseCredentialType::getAllProvidesTypes(); if (!in_array($provides_type, $all_types)) { - $provides_type = PassphraseCredentialTypePassword::PROVIDES_TYPE; + $provides_type = PassphrasePasswordCredentialType::PROVIDES_TYPE; } $credentials = id(new PassphraseCredentialQuery())