Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15404877
D18892.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D18892.diff
View Options
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
@@ -2126,6 +2126,7 @@
'PhabricatorAuthSessionGarbageCollector' => 'applications/auth/garbagecollector/PhabricatorAuthSessionGarbageCollector.php',
'PhabricatorAuthSessionInfo' => 'applications/auth/data/PhabricatorAuthSessionInfo.php',
'PhabricatorAuthSessionQuery' => 'applications/auth/query/PhabricatorAuthSessionQuery.php',
+ 'PhabricatorAuthSessionRevoker' => 'applications/auth/revoker/PhabricatorAuthSessionRevoker.php',
'PhabricatorAuthSetPasswordController' => 'applications/auth/controller/PhabricatorAuthSetPasswordController.php',
'PhabricatorAuthSetupCheck' => 'applications/config/check/PhabricatorAuthSetupCheck.php',
'PhabricatorAuthStartController' => 'applications/auth/controller/PhabricatorAuthStartController.php',
@@ -7413,6 +7414,7 @@
'PhabricatorAuthSessionGarbageCollector' => 'PhabricatorGarbageCollector',
'PhabricatorAuthSessionInfo' => 'Phobject',
'PhabricatorAuthSessionQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
+ 'PhabricatorAuthSessionRevoker' => 'PhabricatorAuthRevoker',
'PhabricatorAuthSetPasswordController' => 'PhabricatorAuthController',
'PhabricatorAuthSetupCheck' => 'PhabricatorSetupCheck',
'PhabricatorAuthStartController' => 'PhabricatorAuthController',
diff --git a/src/applications/auth/revoker/PhabricatorAuthSessionRevoker.php b/src/applications/auth/revoker/PhabricatorAuthSessionRevoker.php
new file mode 100644
--- /dev/null
+++ b/src/applications/auth/revoker/PhabricatorAuthSessionRevoker.php
@@ -0,0 +1,33 @@
+<?php
+
+final class PhabricatorAuthSessionRevoker
+ extends PhabricatorAuthRevoker {
+
+ const REVOKERKEY = 'session';
+
+ public function revokeAllCredentials() {
+ $table = new PhabricatorAuthSession();
+ $conn = $table->establishConnection('w');
+
+ queryfx(
+ $conn,
+ 'DELETE FROM %T',
+ $table->getTableName());
+
+ return $conn->getAffectedRows();
+ }
+
+ public function revokeCredentialsFrom($object) {
+ $table = new PhabricatorAuthSession();
+ $conn = $table->establishConnection('w');
+
+ queryfx(
+ $conn,
+ 'DELETE FROM %T WHERE userPHID = %s',
+ $table->getTableName(),
+ $object->getPHID());
+
+ return $conn->getAffectedRows();
+ }
+
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 19, 9:29 AM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7698425
Default Alt Text
D18892.diff (2 KB)
Attached To
Mode
D18892: Add a `bin/auth revoke` revoker for sessions
Attached
Detach File
Event Timeline
Log In to Comment