@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add a `bin/auth revoke` revoker for temporary tokens

Summary: Ref T13043. Allows CLI revocation of temporary ("forgot password", "one-time login") tokens.

Test Plan: Used "Forgot Password?" to generate tokens, used `bin/auth revoke --type temporary` with `--from` and `--everywhere` to revoke them.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13043

Differential Revision: https://secure.phabricator.com/D18891

+40
+2
src/__phutil_library_map__.php
··· 2133 2133 'PhabricatorAuthTemporaryToken' => 'applications/auth/storage/PhabricatorAuthTemporaryToken.php', 2134 2134 'PhabricatorAuthTemporaryTokenGarbageCollector' => 'applications/auth/garbagecollector/PhabricatorAuthTemporaryTokenGarbageCollector.php', 2135 2135 'PhabricatorAuthTemporaryTokenQuery' => 'applications/auth/query/PhabricatorAuthTemporaryTokenQuery.php', 2136 + 'PhabricatorAuthTemporaryTokenRevoker' => 'applications/auth/revoker/PhabricatorAuthTemporaryTokenRevoker.php', 2136 2137 'PhabricatorAuthTemporaryTokenType' => 'applications/auth/tokentype/PhabricatorAuthTemporaryTokenType.php', 2137 2138 'PhabricatorAuthTemporaryTokenTypeModule' => 'applications/auth/tokentype/PhabricatorAuthTemporaryTokenTypeModule.php', 2138 2139 'PhabricatorAuthTerminateSessionController' => 'applications/auth/controller/PhabricatorAuthTerminateSessionController.php', ··· 7422 7423 ), 7423 7424 'PhabricatorAuthTemporaryTokenGarbageCollector' => 'PhabricatorGarbageCollector', 7424 7425 'PhabricatorAuthTemporaryTokenQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 7426 + 'PhabricatorAuthTemporaryTokenRevoker' => 'PhabricatorAuthRevoker', 7425 7427 'PhabricatorAuthTemporaryTokenType' => 'Phobject', 7426 7428 'PhabricatorAuthTemporaryTokenTypeModule' => 'PhabricatorConfigModule', 7427 7429 'PhabricatorAuthTerminateSessionController' => 'PhabricatorAuthController',
+33
src/applications/auth/revoker/PhabricatorAuthTemporaryTokenRevoker.php
··· 1 + <?php 2 + 3 + final class PhabricatorAuthTemporaryTokenRevoker 4 + extends PhabricatorAuthRevoker { 5 + 6 + const REVOKERKEY = 'temporary'; 7 + 8 + public function revokeAllCredentials() { 9 + $table = new PhabricatorAuthTemporaryToken(); 10 + $conn = $table->establishConnection('w'); 11 + 12 + queryfx( 13 + $conn, 14 + 'DELETE FROM %T', 15 + $table->getTableName()); 16 + 17 + return $conn->getAffectedRows(); 18 + } 19 + 20 + public function revokeCredentialsFrom($object) { 21 + $table = new PhabricatorAuthTemporaryToken(); 22 + $conn = $table->establishConnection('w'); 23 + 24 + queryfx( 25 + $conn, 26 + 'DELETE FROM %T WHERE tokenResource = %s', 27 + $table->getTableName(), 28 + $object->getPHID()); 29 + 30 + return $conn->getAffectedRows(); 31 + } 32 + 33 + }
+5
src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php
··· 1646 1646 '%s objects.', 1647 1647 ), 1648 1648 1649 + 'Destroyed %s credential(s) of type "%s".' => array( 1650 + 'Destroyed one credential of type "%2$s".', 1651 + 'Destroyed %s credentials of type "%s".', 1652 + ), 1653 + 1649 1654 ); 1650 1655 } 1651 1656