diff options
author | Dylan William Hardison <dylan@hardison.net> | 2018-03-04 02:18:33 +0100 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-03-10 21:54:38 +0100 |
commit | d6bc2a79456a319fe073a470d1643721bf7adf5e (patch) | |
tree | c5c087e61e4c075ead2f295931037b30051d7ced /extensions/BMO | |
parent | f57a87a51e4d3e39a6fc552b963621625b2db899 (diff) | |
download | bugzilla-d6bc2a79456a319fe073a470d1643721bf7adf5e.tar.gz bugzilla-d6bc2a79456a319fe073a470d1643721bf7adf5e.tar.xz |
support extensions better
Diffstat (limited to 'extensions/BMO')
-rw-r--r-- | extensions/BMO/Extension.pm | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm index 2d5d2b182..08a7beb90 100644 --- a/extensions/BMO/Extension.pm +++ b/extensions/BMO/Extension.pm @@ -46,6 +46,7 @@ use Bugzilla::User; use Bugzilla::UserAgent qw(detect_platform detect_op_sys); use Bugzilla::User::Setting; use Bugzilla::Util; +use Bugzilla::PSGI qw(compile_cgi); use Date::Parse; use DateTime; @@ -1666,6 +1667,28 @@ sub webservice { $dispatch->{BMO} = "Bugzilla::Extension::BMO::WebService"; } +sub psgi_builder { + my ($self, $args) = @_; + my $mount = $args->{mount}; + + my $ses_index = Plack::Builder::builder { + my $auth_user = Bugzilla->localconfig->{ses_username}; + my $auth_pass = Bugzilla->localconfig->{ses_password}; + Plack::Builder::enable "Auth::Basic", authenticator => sub { + my ($username, $password, $env) = @_; + return ( $auth_user + && $auth_pass + && $username + && $password + && $username eq $auth_user + && $password eq $auth_pass ); + }; + compile_cgi("ses/index.cgi"); + }; + + $mount->{'ses/index.cgi'} = $ses_index; +} + our $search_content_matches; BEGIN { $search_content_matches = \&Bugzilla::Search::_content_matches; |