@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.

OAuthServer - implement destructible interface on oauth server client objects

Summary: Fixes T6955.

Test Plan: made an oauth app. made a test authorization. ran bin/remove destroy <phid of oauth client> and there were no errors. verified oauth app and test authorization were both gone.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T6955

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

+32 -1
+32 -1
src/applications/oauthserver/storage/PhabricatorOAuthServerClient.php
··· 2 2 3 3 final class PhabricatorOAuthServerClient 4 4 extends PhabricatorOAuthServerDAO 5 - implements PhabricatorPolicyInterface { 5 + implements 6 + PhabricatorPolicyInterface, 7 + PhabricatorDestructibleInterface { 6 8 7 9 protected $secret; 8 10 protected $name; ··· 89 91 return null; 90 92 } 91 93 94 + /* -( PhabricatorDestructibleInterface )----------------------------------- */ 95 + 96 + public function destroyObjectPermanently( 97 + PhabricatorDestructionEngine $engine) { 98 + 99 + $this->openTransaction(); 100 + $this->delete(); 101 + 102 + $authorizations = id(new PhabricatorOAuthClientAuthorization()) 103 + ->loadAllWhere('clientPHID = %s', $this->getPHID()); 104 + foreach ($authorizations as $authorization) { 105 + $authorization->delete(); 106 + } 107 + 108 + $tokens = id(new PhabricatorOAuthServerAccessToken()) 109 + ->loadAllWhere('clientPHID = %s', $this->getPHID()); 110 + foreach ($tokens as $token) { 111 + $token->delete(); 112 + } 113 + 114 + $codes = id(new PhabricatorOAuthServerAuthorizationCode()) 115 + ->loadAllWhere('clientPHID = %s', $this->getPHID()); 116 + foreach ($codes as $code) { 117 + $code->delete(); 118 + } 119 + 120 + $this->saveTransaction(); 121 + 122 + } 92 123 }