1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 12:00:55 +01:00

Remove all references to the Conduit ConnectionLog

Summary:
Ref T5955, T9980, T9982.

We currently store two types of Conduit logs: //connection// logs and //method// logs.

Originally, Conduit worked like web logins: you'd call `conduit.connect` and then get a session back. This approach still works, but new clients don't use it and it will probably stop working eventually after T5955 is further along.

There was no real reason for things to work like this and no other API in the world does, I think it was just slightly easier to implement back in 2011.

This table was used to group up related calls in a UI long ago, I think, but that got deleted at some point. In any case, it serves no purpose in modern Phabricator.

Test Plan: `grep`

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T5955, T9980, T9982

Differential Revision: https://secure.phabricator.com/D14780
This commit is contained in:
epriestley 2015-12-14 12:47:09 -08:00
parent 4a147dcbfb
commit 0692115953
5 changed files with 2 additions and 71 deletions

View file

@ -227,7 +227,6 @@ phutil_register_library_map(array(
'ConduitCall' => 'applications/conduit/call/ConduitCall.php',
'ConduitCallTestCase' => 'applications/conduit/call/__tests__/ConduitCallTestCase.php',
'ConduitConnectConduitAPIMethod' => 'applications/conduit/method/ConduitConnectConduitAPIMethod.php',
'ConduitConnectionGarbageCollector' => 'applications/conduit/garbagecollector/ConduitConnectionGarbageCollector.php',
'ConduitEpochParameterType' => 'applications/conduit/parametertype/ConduitEpochParameterType.php',
'ConduitException' => 'applications/conduit/protocol/exception/ConduitException.php',
'ConduitGetCapabilitiesConduitAPIMethod' => 'applications/conduit/method/ConduitGetCapabilitiesConduitAPIMethod.php',
@ -1884,7 +1883,6 @@ phutil_register_library_map(array(
'PhabricatorConduitAPIController' => 'applications/conduit/controller/PhabricatorConduitAPIController.php',
'PhabricatorConduitApplication' => 'applications/conduit/application/PhabricatorConduitApplication.php',
'PhabricatorConduitCertificateToken' => 'applications/conduit/storage/PhabricatorConduitCertificateToken.php',
'PhabricatorConduitConnectionLog' => 'applications/conduit/storage/PhabricatorConduitConnectionLog.php',
'PhabricatorConduitConsoleController' => 'applications/conduit/controller/PhabricatorConduitConsoleController.php',
'PhabricatorConduitController' => 'applications/conduit/controller/PhabricatorConduitController.php',
'PhabricatorConduitDAO' => 'applications/conduit/storage/PhabricatorConduitDAO.php',
@ -4089,7 +4087,6 @@ phutil_register_library_map(array(
'ConduitCall' => 'Phobject',
'ConduitCallTestCase' => 'PhabricatorTestCase',
'ConduitConnectConduitAPIMethod' => 'ConduitAPIMethod',
'ConduitConnectionGarbageCollector' => 'PhabricatorGarbageCollector',
'ConduitEpochParameterType' => 'ConduitListParameterType',
'ConduitException' => 'Exception',
'ConduitGetCapabilitiesConduitAPIMethod' => 'ConduitAPIMethod',
@ -5999,7 +5996,6 @@ phutil_register_library_map(array(
'PhabricatorConduitAPIController' => 'PhabricatorConduitController',
'PhabricatorConduitApplication' => 'PhabricatorApplication',
'PhabricatorConduitCertificateToken' => 'PhabricatorConduitDAO',
'PhabricatorConduitConnectionLog' => 'PhabricatorConduitDAO',
'PhabricatorConduitConsoleController' => 'PhabricatorConduitController',
'PhabricatorConduitController' => 'PhabricatorController',
'PhabricatorConduitDAO' => 'PhabricatorLiskDAO',

View file

@ -1,30 +0,0 @@
<?php
final class ConduitConnectionGarbageCollector
extends PhabricatorGarbageCollector {
const COLLECTORCONST = 'conduit.connections';
public function getCollectorName() {
return pht('Conduit Connections');
}
public function getDefaultRetentionPolicy() {
return phutil_units('180 days in seconds');
}
protected function collectGarbage() {
$table = new PhabricatorConduitConnectionLog();
$conn_w = $table->establishConnection('w');
queryfx(
$conn_w,
'DELETE FROM %T WHERE dateCreated < %d
ORDER BY dateCreated ASC LIMIT 100',
$table->getTableName(),
$this->getGarbageEpoch());
return ($conn_w->getAffectedRows() == 100);
}
}

View file

@ -63,14 +63,6 @@ final class ConduitConnectConduitAPIMethod extends ConduitAPIMethod {
->truncateString($client_description);
$username = (string)$request->getValue('user');
// Log the connection, regardless of the outcome of checks below.
$connection = new PhabricatorConduitConnectionLog();
$connection->setClient($client);
$connection->setClientVersion($client_version);
$connection->setClientDescription($client_description);
$connection->setUsername($username);
$connection->save();
switch ($client) {
case 'arc':
$server_version = 6;
@ -154,7 +146,7 @@ final class ConduitConnectConduitAPIMethod extends ConduitAPIMethod {
}
return array(
'connectionID' => $connection->getID(),
'connectionID' => mt_rand(),
'sessionKey' => $session_key,
'userPHID' => $user->getPHID(),
);

View file

@ -1,26 +0,0 @@
<?php
final class PhabricatorConduitConnectionLog extends PhabricatorConduitDAO {
protected $client;
protected $clientVersion;
protected $clientDescription;
protected $username;
protected function getConfiguration() {
return array(
self::CONFIG_COLUMN_SCHEMA => array(
'client' => 'text255?',
'clientVersion' => 'text255?',
'clientDescription' => 'text255?',
'username' => 'text255?',
),
self::CONFIG_KEY_SCHEMA => array(
'key_created' => array(
'columns' => array('dateCreated'),
),
),
) + parent::getConfiguration();
}
}

View file

@ -46,8 +46,7 @@ There is a web interface for viewing and testing Conduit called the "Conduit
Console", implemented by @{class:PhabricatorConduitConsoleController} at
`/conduit/`.
A log of connections and calls is stored by
@{class:PhabricatorConduitConnectionLog} and
A log of connections and calls is stored in
@{class:PhabricatorConduitMethodCallLog}, and can be accessed on the web via
@{class:PhabricatorConduitLogController} at `/conduit/log/`.