summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extensions/MozReview/Extension.pm22
-rw-r--r--extensions/MozReview/template/en/default/hook/admin/params/editparams-current_panel.html.tmpl1
2 files changed, 23 insertions, 0 deletions
diff --git a/extensions/MozReview/Extension.pm b/extensions/MozReview/Extension.pm
index 1f2758f9f..4e1951ed4 100644
--- a/extensions/MozReview/Extension.pm
+++ b/extensions/MozReview/Extension.pm
@@ -54,6 +54,17 @@ sub template_before_process {
}
}
+sub auth_delegation_confirm {
+ my ($self, $args) = @_;
+ my $mozreview_callback_url = Bugzilla->params->{mozreview_auth_callback_url};
+
+ return unless $mozreview_callback_url;
+
+ if (index($args->{callback}, $mozreview_callback_url) == 0) {
+ ${$args->{skip_confirmation}} = 1;
+ }
+}
+
sub config_modify_panels {
my ($self, $args) = @_;
push @{ $args->{panels}->{advanced}->{params} }, {
@@ -62,6 +73,17 @@ sub config_modify_panels {
default => '',
checker => \&check_urlbase
};
+ push @{ $args->{panels}->{advanced}->{params} }, {
+ name => 'mozreview_auth_callback_url',
+ type => 't',
+ default => '',
+ checker => sub {
+ my ($url) = (@_);
+
+ return 'must be an HTTP/HTTPS absolute URL' unless $url =~ m{^https?://};
+ return '';
+ }
+ };
}
__PACKAGE__->NAME;
diff --git a/extensions/MozReview/template/en/default/hook/admin/params/editparams-current_panel.html.tmpl b/extensions/MozReview/template/en/default/hook/admin/params/editparams-current_panel.html.tmpl
index f16aaddb8..eb08f26eb 100644
--- a/extensions/MozReview/template/en/default/hook/admin/params/editparams-current_panel.html.tmpl
+++ b/extensions/MozReview/template/en/default/hook/admin/params/editparams-current_panel.html.tmpl
@@ -8,4 +8,5 @@
[% IF panel.name == "advanced" %]
[% panel.param_descs.mozreview_base_url = 'MozReview Base URL' %]
+ [% panel.param_descs.mozreview_auth_callback_url = 'MozReview Auth Delegation URL' %]
[% END -%]