mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-30 02:32:42 +01:00
Add a "--force" flag to bin/auth revoke
Summary: Ref T13043. I'd like to replace the manual credential revocation in the Phacility export workflow with shared code in `bin/auth revoke`, but we need it to run non-interactively. Add a `--force` flag purely to make our lives easier. Test Plan: Ran `bin/auth revoke --everywhere ...` with and without `--force`. Got prompted without, got total annihilation with. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13043 Differential Revision: https://secure.phabricator.com/D18895
This commit is contained in:
parent
9c00a43784
commit
42e2cd9af0
1 changed files with 6 additions and 1 deletions
|
@ -34,6 +34,10 @@ final class PhabricatorAuthManagementRevokeWorkflow
|
||||||
'name' => 'everywhere',
|
'name' => 'everywhere',
|
||||||
'help' => pht('Revoke from all credential owners.'),
|
'help' => pht('Revoke from all credential owners.'),
|
||||||
),
|
),
|
||||||
|
array(
|
||||||
|
'name' => 'force',
|
||||||
|
'help' => pht('Revoke credentials without prompting.'),
|
||||||
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,6 +45,7 @@ final class PhabricatorAuthManagementRevokeWorkflow
|
||||||
$viewer = PhabricatorUser::getOmnipotentUser();
|
$viewer = PhabricatorUser::getOmnipotentUser();
|
||||||
|
|
||||||
$all_types = PhabricatorAuthRevoker::getAllRevokers();
|
$all_types = PhabricatorAuthRevoker::getAllRevokers();
|
||||||
|
$is_force = $args->getArg('force');
|
||||||
|
|
||||||
$type = $args->getArg('type');
|
$type = $args->getArg('type');
|
||||||
$is_everything = $args->getArg('everything');
|
$is_everything = $args->getArg('everything');
|
||||||
|
@ -97,7 +102,7 @@ final class PhabricatorAuthManagementRevokeWorkflow
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($is_everywhere) {
|
if ($is_everywhere && !$is_force) {
|
||||||
echo id(new PhutilConsoleBlock())
|
echo id(new PhutilConsoleBlock())
|
||||||
->addParagraph(
|
->addParagraph(
|
||||||
pht(
|
pht(
|
||||||
|
|
Loading…
Reference in a new issue