From c6998207ab00c8bbb6b4f5f5fe8f7c22aade217a Mon Sep 17 00:00:00 2001 From: lkassianik Date: Thu, 7 Aug 2014 16:33:54 -0700 Subject: [PATCH] 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 --- .../storage/PassphraseCredential.php | 18 +++++++++++++++++- .../PhabricatorDestructibleInterface.php | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/applications/passphrase/storage/PassphraseCredential.php b/src/applications/passphrase/storage/PassphraseCredential.php index 8dc8de2fe4..20d2437094 100644 --- a/src/applications/passphrase/storage/PassphraseCredential.php +++ b/src/applications/passphrase/storage/PassphraseCredential.php @@ -1,7 +1,8 @@ openTransaction(); + $secrets = id(new PassphraseSecret())->loadAllWhere( + 'id = %d', + $this->getSecretID()); + foreach ($secrets as $secret) { + $secret->delete(); + } + $this->delete(); + $this->saveTransaction(); + } } diff --git a/src/applications/system/interface/PhabricatorDestructibleInterface.php b/src/applications/system/interface/PhabricatorDestructibleInterface.php index 3b69f87c3a..08ee240529 100644 --- a/src/applications/system/interface/PhabricatorDestructibleInterface.php +++ b/src/applications/system/interface/PhabricatorDestructibleInterface.php @@ -11,7 +11,7 @@ interface PhabricatorDestructibleInterface { // TEMPLATE IMPLEMENTATION ///////////////////////////////////////////////////// -/* -( PhabricatorDestructableInterface )----------------------------------- */ +/* -( PhabricatorDestructibleInterface )----------------------------------- */ /* public function destroyObjectPermanently(