diff --git a/resources/sql/patches/20131121.repocredentials.2.mig.php b/resources/sql/patches/20131121.repocredentials.2.mig.php --- a/resources/sql/patches/20131121.repocredentials.2.mig.php +++ b/resources/sql/patches/20131121.repocredentials.2.mig.php @@ -26,7 +26,7 @@ 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 @@ $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 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1260,17 +1260,17 @@ '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 @@ 'DivinerDAO', 'PhabricatorPolicyInterface', 'PhabricatorDestructibleInterface', + 'PhabricatorApplicationTransactionInterface', ), 'DivinerLivePublisher' => 'DivinerPublisher', 'DivinerLiveSymbol' => array( @@ -4641,17 +4642,17 @@ '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 --- a/src/applications/diffusion/controller/DiffusionRepositoryCreateController.php +++ b/src/applications/diffusion/controller/DiffusionRepositoryCreateController.php @@ -591,8 +591,8 @@ 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 @@ $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 @@ 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 @@ } 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 --- a/src/applications/drydock/interface/command/DrydockSSHCommandInterface.php +++ b/src/applications/drydock/interface/command/DrydockSSHCommandInterface.php @@ -24,7 +24,7 @@ } 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 --- a/src/applications/drydock/interface/filesystem/DrydockSFTPFilesystemInterface.php +++ b/src/applications/drydock/interface/filesystem/DrydockSFTPFilesystemInterface.php @@ -16,7 +16,7 @@ ->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 --- a/src/applications/harbormaster/step/HarbormasterHTTPRequestBuildStepImplementation.php +++ b/src/applications/harbormaster/step/HarbormasterHTTPRequestBuildStepImplementation.php @@ -95,9 +95,9 @@ '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 --- a/src/applications/passphrase/conduit/PassphraseQueryConduitAPIMethod.php +++ b/src/applications/passphrase/conduit/PassphraseQueryConduitAPIMethod.php @@ -78,7 +78,7 @@ } switch ($credential->getCredentialType()) { - case PassphraseCredentialTypeSSHPrivateKeyFile::CREDENTIAL_TYPE: + case PassphraseSSHPrivateKeyFileCredentialType::CREDENTIAL_TYPE: if ($secret) { $material['file'] = $secret; } @@ -86,8 +86,8 @@ $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 @@ $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 rename from src/applications/passphrase/credentialtype/PassphraseCredentialTypePassword.php rename to src/applications/passphrase/credentialtype/PassphrasePasswordCredentialType.php --- 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 --- a/src/applications/passphrase/keys/PassphraseSSHKey.php +++ b/src/applications/passphrase/keys/PassphraseSSHKey.php @@ -9,13 +9,13 @@ 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 --- a/src/applications/repository/storage/__tests__/PhabricatorRepositoryURITestCase.php +++ b/src/applications/repository/storage/__tests__/PhabricatorRepositoryURITestCase.php @@ -19,8 +19,8 @@ $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 --- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldCredential.php +++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldCredential.php @@ -24,7 +24,7 @@ $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())