summaryrefslogtreecommitdiffstats
path: root/extensions/MozReview
diff options
context:
space:
mode:
authorDylan Hardison <dylan@mozilla.com>2016-02-27 16:17:34 +0100
committerDylan Hardison <dylan@mozilla.com>2016-02-27 16:18:03 +0100
commit110b14a3f96e5ec0511a232022484f7afb691535 (patch)
tree93c0245d010d35adcd8eaa9c5a8a8ce51e3ee016 /extensions/MozReview
parent5eea1e0851fedc5708e69daabc9fd085881b9a6a (diff)
downloadbugzilla-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.pm12
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'};