Page MenuHomePhabricator

D10791.id25913.diff
No OneTemporary

D10791.id25913.diff

diff --git a/resources/sql/autopatches/20141105.ssh.1.rename.sql b/resources/sql/autopatches/20141105.ssh.1.rename.sql
new file mode 100644
--- /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
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -1317,6 +1317,7 @@
'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 @@
'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 @@
'PhabricatorAuthProviderConfigTransactionQuery' => 'PhabricatorApplicationTransactionQuery',
'PhabricatorAuthRegisterController' => 'PhabricatorAuthController',
'PhabricatorAuthRevokeTokenController' => 'PhabricatorAuthController',
+ 'PhabricatorAuthSSHKey' => array(
+ 'PhabricatorAuthDAO',
+ 'PhabricatorPolicyInterface',
+ ),
'PhabricatorAuthSSHKeyQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'PhabricatorAuthSSHPublicKey' => 'Phobject',
'PhabricatorAuthSession' => array(
@@ -5631,10 +5635,6 @@
'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
--- a/src/applications/auth/query/PhabricatorAuthSSHKeyQuery.php
+++ b/src/applications/auth/query/PhabricatorAuthSSHKeyQuery.php
@@ -24,7 +24,7 @@
}
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
rename from src/applications/settings/storage/PhabricatorUserSSHKey.php
rename to src/applications/auth/storage/PhabricatorAuthSSHKey.php
--- a/src/applications/settings/storage/PhabricatorUserSSHKey.php
+++ b/src/applications/auth/storage/PhabricatorAuthSSHKey.php
@@ -1,7 +1,7 @@
<?php
-final class PhabricatorUserSSHKey
- extends PhabricatorUserDAO
+final class PhabricatorAuthSSHKey
+ extends PhabricatorAuthDAO
implements PhabricatorPolicyInterface {
protected $userPHID;
diff --git a/src/applications/people/storage/PhabricatorUser.php b/src/applications/people/storage/PhabricatorUser.php
--- a/src/applications/people/storage/PhabricatorUser.php
+++ b/src/applications/people/storage/PhabricatorUser.php
@@ -896,7 +896,7 @@
$profile->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
--- a/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php
+++ b/src/applications/settings/panel/PhabricatorSettingsPanelSSHKeys.php
@@ -59,7 +59,7 @@
return new Aphront404Response();
}
} else {
- $key = new PhabricatorUserSSHKey();
+ $key = new PhabricatorAuthSSHKey();
$key->setUserPHID($user->getPHID());
}
@@ -251,7 +251,7 @@
private function processDelete(
AphrontRequest $request,
- PhabricatorUserSSHKey $key) {
+ PhabricatorAuthSSHKey $key) {
$viewer = $request->getUser();
$user = $this->getUser();
@@ -308,7 +308,7 @@
$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)

File Metadata

Mime Type
text/plain
Expires
Fri, May 10, 7:50 AM (3 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6281815
Default Alt Text
D10791.id25913.diff (5 KB)

Event Timeline