diff options
author | Dylan Hardison <dylan@mozilla.com> | 2016-02-27 16:17:34 +0100 |
---|---|---|
committer | Dylan Hardison <dylan@mozilla.com> | 2016-02-27 16:18:03 +0100 |
commit | 110b14a3f96e5ec0511a232022484f7afb691535 (patch) | |
tree | 93c0245d010d35adcd8eaa9c5a8a8ce51e3ee016 /extensions/MozReview | |
parent | 5eea1e0851fedc5708e69daabc9fd085881b9a6a (diff) | |
download | bugzilla-110b14a3f96e5ec0511a232022484f7afb691535.tar.gz bugzilla-110b14a3f96e5ec0511a232022484f7afb691535.tar.xz |
Bug 1223421 - Hide/Obfuscate MozReview API Keys
Diffstat (limited to 'extensions/MozReview')
-rw-r--r-- | extensions/MozReview/Extension.pm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/extensions/MozReview/Extension.pm b/extensions/MozReview/Extension.pm index e523bc2d8..1969ade42 100644 --- a/extensions/MozReview/Extension.pm +++ b/extensions/MozReview/Extension.pm @@ -30,6 +30,18 @@ my @METHOD_WHITELIST = ( 'Bug.update_attachment', ); +BEGIN { + package Bugzilla::User::APIKey; + + sub is_mozreview { + my ($self) = @_; + my $mozreview_app_id = Bugzilla->params->{mozreview_app_id}; + return 0 unless $mozreview_app_id; + + return 1 if $self->app_id && $self->app_id eq $mozreview_app_id; + } +} + sub template_before_process { my ($self, $args) = @_; my $file = $args->{'file'}; |