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

T5409, allow bin/remove to permanently destroy credential and everything associated with it

Summary: Fixes T5409, bin/remove permanently destroys credential

Test Plan: Add a passphrase, run bin/remove destroy K123 --trace, verify credential no longer exists

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, Korvin

Maniphest Tasks: T5409

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

authored by

lkassianik and committed by
epriestley
c6998207 20d8b1bd

+18 -2
+17 -1
src/applications/passphrase/storage/PassphraseCredential.php
··· 1 1 <?php 2 2 3 3 final class PassphraseCredential extends PassphraseDAO 4 - implements PhabricatorPolicyInterface { 4 + implements PhabricatorPolicyInterface, 5 + PhabricatorDestructibleInterface { 5 6 6 7 protected $name; 7 8 protected $credentialType; ··· 83 84 return null; 84 85 } 85 86 87 + /* -( PhabricatorDestructibleInterface )----------------------------------- */ 88 + 89 + public function destroyObjectPermanently( 90 + PhabricatorDestructionEngine $engine) { 91 + 92 + $this->openTransaction(); 93 + $secrets = id(new PassphraseSecret())->loadAllWhere( 94 + 'id = %d', 95 + $this->getSecretID()); 96 + foreach ($secrets as $secret) { 97 + $secret->delete(); 98 + } 99 + $this->delete(); 100 + $this->saveTransaction(); 101 + } 86 102 }
+1 -1
src/applications/system/interface/PhabricatorDestructibleInterface.php
··· 11 11 // TEMPLATE IMPLEMENTATION ///////////////////////////////////////////////////// 12 12 13 13 14 - /* -( PhabricatorDestructableInterface )----------------------------------- */ 14 + /* -( PhabricatorDestructibleInterface )----------------------------------- */ 15 15 /* 16 16 17 17 public function destroyObjectPermanently(