Path: blob/master/src/applications/auth/revoker/PhabricatorAuthConduitTokenRevoker.php
12256 views
<?php12final class PhabricatorAuthConduitTokenRevoker3extends PhabricatorAuthRevoker {45const REVOKERKEY = 'conduit';67public function getRevokerName() {8return pht('Conduit API Tokens');9}1011public function getRevokerDescription() {12return pht(13"Revokes all Conduit API tokens used to access the API.\n\n".14"Users will need to use `arc install-certificate` to install new ".15"API tokens before `arc` commands will work. Bots and scripts which ".16"access the API will need to have new tokens generated and ".17"installed.");18}1920public function revokeAllCredentials() {21$table = id(new PhabricatorConduitToken());22$conn = $table->establishConnection('w');2324queryfx(25$conn,26'DELETE FROM %T',27$table->getTableName());2829return $conn->getAffectedRows();30}3132public function revokeCredentialsFrom($object) {33$table = id(new PhabricatorConduitToken());34$conn = $table->establishConnection('w');3536queryfx(37$conn,38'DELETE FROM %T WHERE objectPHID = %s',39$table->getTableName(),40$object->getPHID());4142return $conn->getAffectedRows();43}4445}464748