diff options
author | Dylan William Hardison <dylan@mozilla.com> | 2015-06-16 21:43:04 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2015-06-16 21:43:04 +0200 |
commit | ca30cabb0b4b3085d85edc54171f21d2673c8b6c (patch) | |
tree | 5d4573585780da46ea458d7a83e353c81a9d055b /extensions/MozReview | |
parent | d2d610f447e9d2e100ee1634fac6c69f81ca1a1c (diff) | |
download | bugzilla-ca30cabb0b4b3085d85edc54171f21d2673c8b6c.tar.gz bugzilla-ca30cabb0b4b3085d85edc54171f21d2673c8b6c.tar.xz |
Bug 1163761: Allow MozReview to skip user consent screen for Authentication Delegation
Diffstat (limited to 'extensions/MozReview')
-rw-r--r-- | extensions/MozReview/Extension.pm | 22 | ||||
-rw-r--r-- | extensions/MozReview/template/en/default/hook/admin/params/editparams-current_panel.html.tmpl | 1 |
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 -%] |