From 110b14a3f96e5ec0511a232022484f7afb691535 Mon Sep 17 00:00:00 2001 From: Dylan Hardison Date: Sat, 27 Feb 2016 10:17:34 -0500 Subject: Bug 1223421 - Hide/Obfuscate MozReview API Keys --- extensions/MozReview/Extension.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'extensions/MozReview') 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'}; -- cgit v1.2.3-24-g4f1b