mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 12:00:55 +01:00
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
This commit is contained in:
parent
20d8b1bdd3
commit
c6998207ab
2 changed files with 18 additions and 2 deletions
|
@ -1,7 +1,8 @@
|
|||
<?php
|
||||
|
||||
final class PassphraseCredential extends PassphraseDAO
|
||||
implements PhabricatorPolicyInterface {
|
||||
implements PhabricatorPolicyInterface,
|
||||
PhabricatorDestructibleInterface {
|
||||
|
||||
protected $name;
|
||||
protected $credentialType;
|
||||
|
@ -83,4 +84,19 @@ final class PassphraseCredential extends PassphraseDAO
|
|||
return null;
|
||||
}
|
||||
|
||||
/* -( PhabricatorDestructibleInterface )----------------------------------- */
|
||||
|
||||
public function destroyObjectPermanently(
|
||||
PhabricatorDestructionEngine $engine) {
|
||||
|
||||
$this->openTransaction();
|
||||
$secrets = id(new PassphraseSecret())->loadAllWhere(
|
||||
'id = %d',
|
||||
$this->getSecretID());
|
||||
foreach ($secrets as $secret) {
|
||||
$secret->delete();
|
||||
}
|
||||
$this->delete();
|
||||
$this->saveTransaction();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ interface PhabricatorDestructibleInterface {
|
|||
// TEMPLATE IMPLEMENTATION /////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/* -( PhabricatorDestructableInterface )----------------------------------- */
|
||||
/* -( PhabricatorDestructibleInterface )----------------------------------- */
|
||||
/*
|
||||
|
||||
public function destroyObjectPermanently(
|
||||
|
|
Loading…
Reference in a new issue