-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into bg-bulk-edits
- Loading branch information
Showing
215 changed files
with
1,305 additions
and
919 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
# | ||
# This Source Code Form is "Incompatible With Secondary Licenses", as | ||
# defined by the Mozilla Public License, v. 2.0. | ||
|
||
package Bugzilla::App::Command::revoke_api_keys; ## no critic (Capitalization) | ||
use 5.10.1; | ||
use Mojo::Base 'Mojolicious::Command'; | ||
|
||
use Bugzilla::Constants; | ||
use Bugzilla::User::APIKey; | ||
use Mojo::File 'path'; | ||
use Mojo::Util 'getopt'; | ||
use PerlX::Maybe 'maybe'; | ||
|
||
has description => 'Revoke api keys'; | ||
has usage => sub { shift->extract_usage }; | ||
|
||
sub run { | ||
my ($self, @args) = @_; | ||
my ($app_id, $description); | ||
|
||
Bugzilla->usage_mode(USAGE_MODE_CMDLINE); | ||
getopt \@args, | ||
'a|app-id=s' => \$app_id, | ||
'd|description-id=s' => \$description; | ||
die $self->usage unless $app_id || $description; | ||
|
||
my $query = { | ||
revoked => 0, | ||
maybe(app_id => $app_id), maybe(description => $description) | ||
}; | ||
my $keys = Bugzilla::User::APIKey->match($query); | ||
foreach my $key (@$keys) { | ||
say 'Updating ', $key->id; | ||
$key->set_revoked(1); | ||
$key->update(); | ||
} | ||
} | ||
|
||
1; | ||
__END__ | ||
=encoding utf8 | ||
=head1 NAME | ||
Bugzilla::App::Command::revoke_api_keys - revoke API keys command | ||
=head1 SYNOPSIS | ||
Usage: APPLICATION revoke_api_keys [OPTIONS] | ||
mojo revoke_api_keys -a deadbeef | ||
Options: | ||
-h, --help Show this summary of available options | ||
-a, --app-id app_id Match against a specific app_id | ||
-d, --description desc Match against a specific description | ||
=head1 DESCRIPTION | ||
L<Bugzilla::App::Command::revoke_api_keys> revokes API keys. | ||
=head1 ATTRIBUTES | ||
L<Bugzilla::App::Command::revoke_api_keys> inherits all attributes from | ||
L<Mojolicious::Command> and implements the following new ones. | ||
=head2 description | ||
my $description = $revoke_api_keys->description; | ||
$revoke_api_keys = $revoke_api_keys->description('Foo'); | ||
Short description of this command, used for the command list. | ||
=head2 usage | ||
my $usage = $revoke_api_keys->usage; | ||
$revoke_api_keys = $revoke_api_keys->usage('Foo'); | ||
Usage information for this command, used for the help screen. | ||
=head1 METHODS | ||
L<Bugzilla::App::Command::revoke_api_keys> inherits all methods from | ||
L<Mojolicious::Command> and implements the following new ones. | ||
=head2 run | ||
$revoke_api_keys->run(@ARGV); | ||
Run this command. | ||
=cut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Bugzilla/Quantum/Plugin/BlockIP.pm → Bugzilla/App/Plugin/BlockIP.pm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Bugzilla/Quantum/Plugin/Hostage.pm → Bugzilla/App/Plugin/Hostage.pm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.