forked from .cyb/cyberman
Block CSRF attempts
This uses Plack::Middleware::CSRFBlock. Also cleaned up various files and organised plack middleware.
This commit is contained in:
parent
a824b5d67c
commit
2afe5b1918
12
app.psgi
12
app.psgi
|
@ -5,16 +5,12 @@ use warnings;
|
|||
use FindBin;
|
||||
use lib "$FindBin::Bin/lib";
|
||||
|
||||
|
||||
# use this block if you don't need middleware, and only have a single target Dancer app to run here
|
||||
use cyberman;
|
||||
|
||||
cyberman->to_app;
|
||||
|
||||
use Plack::Builder;
|
||||
|
||||
builder {
|
||||
enable 'Deflater';
|
||||
cyberman->to_app;
|
||||
enable "Deflater";
|
||||
enable "Session";
|
||||
enable "CSRFBlock";
|
||||
cyberman->to_app;
|
||||
}
|
||||
|
||||
|
|
19
config.yml
19
config.yml
|
@ -1,22 +1,7 @@
|
|||
# This is the main configuration file of your Dancer2 app
|
||||
# env-related settings should go to environments/$env.yml
|
||||
# all the settings in this file will be loaded at Dancer's startup.
|
||||
|
||||
# Your application's name
|
||||
appname: "cyberman"
|
||||
|
||||
# The default layout to use for your application (located in
|
||||
# views/layouts/main.tt)
|
||||
layout: "main"
|
||||
|
||||
# when the charset is set to UTF-8 Dancer2 will handle for you
|
||||
# all the magic of encoding and decoding. You should not care
|
||||
# about unicode within your app when this setting is set (recommended).
|
||||
charset: "UTF-8"
|
||||
|
||||
# template engine
|
||||
# simple: default and very basic template engine
|
||||
# template_toolkit: TT
|
||||
auto_page: 1
|
||||
|
||||
template: "template_toolkit"
|
||||
engines:
|
||||
|
@ -25,8 +10,6 @@ engines:
|
|||
start_tag: '<%'
|
||||
end_tag: '%>'
|
||||
|
||||
auto_page: 1
|
||||
|
||||
plugins:
|
||||
Database:
|
||||
driver: 'SQLite'
|
||||
|
|
5
cpanfile
5
cpanfile
|
@ -4,13 +4,16 @@ requires "YAML" => "0";
|
|||
requires "URL::Encode::XS" => "0";
|
||||
requires "CGI::Deurl::XS" => "0";
|
||||
requires "HTTP::Parser::XS" => "0";
|
||||
requires "Plack::Middleware::Deflater" => "0";
|
||||
requires "Dancer2::Plugin::Database" => "0";
|
||||
requires "DBD::SQLite" => "0";
|
||||
requires "HTML::Entities" => "0";
|
||||
requires "Digest::Bcrypt" => "0";
|
||||
requires "Math::Random::Secure" => "0";
|
||||
|
||||
requires "Plack::Middleware::Deflater" => "0";
|
||||
requires "Plack::Middleware::Session" => "0";
|
||||
requires "Plack::Middleware::CSRFBlock" => "0";
|
||||
|
||||
on "test" => sub {
|
||||
requires "Test::More" => "0";
|
||||
requires "HTTP::Request::Common" => "0";
|
||||
|
|
Loading…
Reference in New Issue