1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-05 19:38:27 +01:00

Move SSHKey table to Auth database

Summary: Ref T5833. Since these will no longer be bound specifically to users, bring them to a more central location.

Test Plan:
  - Edited SSH keys.
  - Ran `bin/ssh-auth` and `bin/ssh-auth-key`.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5833

Differential Revision: https://secure.phabricator.com/D10791
This commit is contained in:
epriestley 2014-11-06 12:37:22 -08:00
parent 6f0d3b0796
commit e29955b48d
6 changed files with 13 additions and 12 deletions

View file

@ -0,0 +1 @@
RENAME TABLE {$NAMESPACE}_user.user_sshkey TO {$NAMESPACE}_auth.auth_sshkey;

View file

@ -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',

View file

@ -24,7 +24,7 @@ final class PhabricatorAuthSSHKeyQuery
}
protected function loadPage() {
$table = new PhabricatorUserSSHKey();
$table = new PhabricatorAuthSSHKey();
$conn_r = $table->establishConnection('r');
$data = queryfx_all(

View file

@ -1,7 +1,7 @@
<?php
final class PhabricatorUserSSHKey
extends PhabricatorUserDAO
final class PhabricatorAuthSSHKey
extends PhabricatorAuthDAO
implements PhabricatorPolicyInterface {
protected $userPHID;

View file

@ -896,7 +896,7 @@ EOBODY;
$profile->delete();
}
$keys = id(new PhabricatorUserSSHKey())->loadAllWhere(
$keys = id(new PhabricatorAuthSSHKey())->loadAllWhere(
'userPHID = %s',
$this->getPHID());
foreach ($keys as $key) {

View file

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