]> git.proxmox.com Git - pve-access-control.git/commitdiff
pveum: add 'tfa delete' subcommand for deleting user-TFA
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Sun, 3 May 2020 14:40:03 +0000 (16:40 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sun, 3 May 2020 14:40:05 +0000 (16:40 +0200)
Allows a user to straight forward delete TFS over CLI, easier as
telling them to edit some config files, and the API is already there.

Short circuit most params of that API call to undef, as they do not
make sense to expose.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/CLI/pveum.pm

index cffd4dac47cff618288c3698467a9440c9c3ba2e..c98dddecd77d3158f6f23b30eb3eb97c90cf10d1 100755 (executable)
@@ -117,6 +117,9 @@ our $cmddef = {
        delete => [ 'PVE::API2::User', 'delete_user', ['userid'] ],
        list   => [ 'PVE::API2::User', 'index', [], {}, $print_api_result, $PVE::RESTHandler::standard_output_options],
        permissions => [ 'PVE::API2::AccessControl', 'permissions', ['userid'], {}, $print_perm_result, $PVE::RESTHandler::standard_output_options],
+       tfa => {
+           delete => [ 'PVE::API2::AccessControl', 'change_tfa', ['userid'], { action => 'delete', key => undef, config => undef, response => undef, }, ],
+       },
        token => {
            add    => [ 'PVE::API2::User', 'generate_token', ['userid', 'tokenid'], {}, $print_api_result, $PVE::RESTHandler::standard_output_options ],
            modify    => [ 'PVE::API2::User', 'update_token_info', ['userid', 'tokenid'], {}, $print_api_result, $PVE::RESTHandler::standard_output_options ],