#!/usr/bin/perl -w
use v5.14;
-use Plack::Builder;
+use Apache2::Authen::Passphrase qw/pwcheck/;
use Plack::App::Gruntmaster;
+use Plack::Builder;
+use Plack::Request;
+
+sub some_auth_required {
+ my $r = Plack::Request->new($_[0]);
+ 0
+}
builder {
- enable 'Static', path => qr,/static/,, pass_through => 1;
+ enable 'Static', path => qr,/static/,;
enable 'Log4perl', category => 'plack', conf => 'log.conf';
+ enable_if \&some_auth_required, 'Auth::Basic', authenticator => sub { eval {pwcheck @_; 1} }, realm => 'Gruntmaster 6000';
Plack::App::Gruntmaster->to_app
}