Page MenuHomePhabricator

D11378.diff
No OneTemporary

D11378.diff

diff --git a/src/applications/oauthserver/storage/PhabricatorOAuthServerClient.php b/src/applications/oauthserver/storage/PhabricatorOAuthServerClient.php
--- a/src/applications/oauthserver/storage/PhabricatorOAuthServerClient.php
+++ b/src/applications/oauthserver/storage/PhabricatorOAuthServerClient.php
@@ -2,7 +2,9 @@
final class PhabricatorOAuthServerClient
extends PhabricatorOAuthServerDAO
- implements PhabricatorPolicyInterface {
+ implements
+ PhabricatorPolicyInterface,
+ PhabricatorDestructibleInterface {
protected $secret;
protected $name;
@@ -89,4 +91,33 @@
return null;
}
+/* -( PhabricatorDestructibleInterface )----------------------------------- */
+
+ public function destroyObjectPermanently(
+ PhabricatorDestructionEngine $engine) {
+
+ $this->openTransaction();
+ $this->delete();
+
+ $authorizations = id(new PhabricatorOAuthClientAuthorization())
+ ->loadAllWhere('clientPHID = %s', $this->getPHID());
+ foreach ($authorizations as $authorization) {
+ $authorization->delete();
+ }
+
+ $tokens = id(new PhabricatorOAuthServerAccessToken())
+ ->loadAllWhere('clientPHID = %s', $this->getPHID());
+ foreach ($tokens as $token) {
+ $token->delete();
+ }
+
+ $codes = id(new PhabricatorOAuthServerAuthorizationCode())
+ ->loadAllWhere('clientPHID = %s', $this->getPHID());
+ foreach ($codes as $code) {
+ $code->delete();
+ }
+
+ $this->saveTransaction();
+
+ }
}

File Metadata

Mime Type
text/plain
Expires
Tue, Mar 18, 4:31 AM (2 d, 20 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7709383
Default Alt Text
D11378.diff (1 KB)

Event Timeline