X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=app.psgi;h=25cf90f686f627746f26560b8be9c99b03e680ea;hb=191f4979def520b8be01554eb954c80ee42df38b;hp=02d6e88f2218e0be2cb1b1442787b8001c63de04;hpb=7dc3247307f2e86af154dc449224f22ba8923c79;p=plack-app-gruntmaster.git diff --git a/app.psgi b/app.psgi index 02d6e88..25cf90f 100644 --- a/app.psgi +++ b/app.psgi @@ -1,11 +1,20 @@ #!/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 'ContentLength'; + 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 }