diff --git a/resources/sql/autopatches/20141105.ssh.1.rename.sql b/resources/sql/autopatches/20141105.ssh.1.rename.sql new file mode 100644 index 0000000000..3aaff9e4d7 --- /dev/null +++ b/resources/sql/autopatches/20141105.ssh.1.rename.sql @@ -0,0 +1 @@ +RENAME TABLE {$NAMESPACE}_user.user_sshkey TO {$NAMESPACE}_auth.auth_sshkey; diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 8eaef59231..5e29a612ae 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1317,6 +1317,7 @@ phutil_register_library_map(array( 'PhabricatorAuthProviderConfigTransactionQuery' => 'applications/auth/query/PhabricatorAuthProviderConfigTransactionQuery.php', 'PhabricatorAuthRegisterController' => 'applications/auth/controller/PhabricatorAuthRegisterController.php', 'PhabricatorAuthRevokeTokenController' => 'applications/auth/controller/PhabricatorAuthRevokeTokenController.php', + 'PhabricatorAuthSSHKey' => 'applications/auth/storage/PhabricatorAuthSSHKey.php', 'PhabricatorAuthSSHKeyQuery' => 'applications/auth/query/PhabricatorAuthSSHKeyQuery.php', 'PhabricatorAuthSSHPublicKey' => 'applications/auth/storage/PhabricatorAuthSSHPublicKey.php', 'PhabricatorAuthSession' => 'applications/auth/storage/PhabricatorAuthSession.php', @@ -2488,7 +2489,6 @@ phutil_register_library_map(array( 'PhabricatorUserProfileEditor' => 'applications/people/editor/PhabricatorUserProfileEditor.php', 'PhabricatorUserRealNameField' => 'applications/people/customfield/PhabricatorUserRealNameField.php', 'PhabricatorUserRolesField' => 'applications/people/customfield/PhabricatorUserRolesField.php', - 'PhabricatorUserSSHKey' => 'applications/settings/storage/PhabricatorUserSSHKey.php', 'PhabricatorUserSchemaSpec' => 'applications/people/storage/PhabricatorUserSchemaSpec.php', 'PhabricatorUserSearchIndexer' => 'applications/people/search/PhabricatorUserSearchIndexer.php', 'PhabricatorUserSinceField' => 'applications/people/customfield/PhabricatorUserSinceField.php', @@ -4383,6 +4383,10 @@ phutil_register_library_map(array( 'PhabricatorAuthProviderConfigTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 'PhabricatorAuthRegisterController' => 'PhabricatorAuthController', 'PhabricatorAuthRevokeTokenController' => 'PhabricatorAuthController', + 'PhabricatorAuthSSHKey' => array( + 'PhabricatorAuthDAO', + 'PhabricatorPolicyInterface', + ), 'PhabricatorAuthSSHKeyQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 'PhabricatorAuthSSHPublicKey' => 'Phobject', 'PhabricatorAuthSession' => array( @@ -5631,10 +5635,6 @@ phutil_register_library_map(array( 'PhabricatorUserProfileEditor' => 'PhabricatorApplicationTransactionEditor', 'PhabricatorUserRealNameField' => 'PhabricatorUserCustomField', 'PhabricatorUserRolesField' => 'PhabricatorUserCustomField', - 'PhabricatorUserSSHKey' => array( - 'PhabricatorUserDAO', - 'PhabricatorPolicyInterface', - ), 'PhabricatorUserSchemaSpec' => 'PhabricatorConfigSchemaSpec', 'PhabricatorUserSearchIndexer' => 'PhabricatorSearchDocumentIndexer', 'PhabricatorUserSinceField' => 'PhabricatorUserCustomField', diff --git a/src/applications/auth/query/PhabricatorAuthSSHKeyQuery.php b/src/applications/auth/query/PhabricatorAuthSSHKeyQuery.php index 987a8420d8..35f4eca4bb 100644 --- a/src/applications/auth/query/PhabricatorAuthSSHKeyQuery.php +++ b/src/applications/auth/query/PhabricatorAuthSSHKeyQuery.php @@ -24,7 +24,7 @@ final class PhabricatorAuthSSHKeyQuery } protected function loadPage() { - $table = new PhabricatorUserSSHKey(); + $table = new PhabricatorAuthSSHKey(); $conn_r = $table->establishConnection('r'); $data = queryfx_all( diff --git a/src/applications/settings/storage/PhabricatorUserSSHKey.php b/src/applications/auth/storage/PhabricatorAuthSSHKey.php similarity index 96% rename from src/applications/settings/storage/PhabricatorUserSSHKey.php rename to src/applications/auth/storage/PhabricatorAuthSSHKey.php index 9c53faac71..eace711311 100644 --- a/src/applications/settings/storage/PhabricatorUserSSHKey.php +++ b/src/applications/auth/storage/PhabricatorAuthSSHKey.php @@ -1,7 +1,7 @@ delete(); } - $keys = id(new PhabricatorUserSSHKey())->loadAllWhere( + $keys = id(new PhabricatorAuthSSHKey())->loadAllWhere( 'userPHID = %s', $this->getPHID()); foreach ($keys as $key) { diff --git a/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php b/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php index a3c3965d42..a2bf1bac89 100644 --- a/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php +++ b/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php @@ -59,7 +59,7 @@ final class PhabricatorSettingsPanelSSHKeys return new Aphront404Response(); } } else { - $key = new PhabricatorUserSSHKey(); + $key = new PhabricatorAuthSSHKey(); $key->setUserPHID($user->getPHID()); } @@ -251,7 +251,7 @@ final class PhabricatorSettingsPanelSSHKeys private function processDelete( AphrontRequest $request, - PhabricatorUserSSHKey $key) { + PhabricatorAuthSSHKey $key) { $viewer = $request->getUser(); $user = $this->getUser(); @@ -308,7 +308,7 @@ final class PhabricatorSettingsPanelSSHKeys $type = $public_key->getType(); $body = $public_key->getBody(); - $key = id(new PhabricatorUserSSHKey()) + $key = id(new PhabricatorAuthSSHKey()) ->setUserPHID($user->getPHID()) ->setName('id_rsa_phabricator') ->setKeyType($type)