X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=stemmaweb%2Flib%2Fstemmaweb.pm;h=74279737f9d5b6e14f3f903cfa5129d0ad93861a;hb=8591038d46bc45c2664c0f8f05ed7076ea9ae9f8;hp=94121c131ec1285705b981273326f4283972bef6;hpb=350a6cdc3f099f91ff26f84facfefb1772db7c9b;p=scpubgit%2Fstemmatology.git diff --git a/stemmaweb/lib/stemmaweb.pm b/stemmaweb/lib/stemmaweb.pm index 94121c1..7427973 100644 --- a/stemmaweb/lib/stemmaweb.pm +++ b/stemmaweb/lib/stemmaweb.pm @@ -4,6 +4,10 @@ use namespace::autoclean; use Catalyst::Runtime 5.80; +use Search::GIN::Extract::Class; +use Search::GIN::Extract::Attributes; +use Search::GIN::Extract::Multiplex; + # Set flags and add plugins for the application. # # Note that ORDERING IS IMPORTANT here as plugins are initialized in order, @@ -20,6 +24,12 @@ use Catalyst qw/ ConfigLoader Static::Simple Unicode::Encoding + Authentication + Session + Session::Store::File + Session::State::Cookie + StatusMessage + StackTrace /; extends 'Catalyst'; @@ -48,6 +58,54 @@ __PACKAGE__->config( stemmaweb->path_to( 'root', 'src' ), ], }, + ## kiokudb auth store testing + 'Plugin::Authentication' => { + default => { + credential => { + class => 'Password', + password_field => 'password', + password_type => 'self_check', + }, + store => { + class => 'Model::KiokuDB', + model_name => 'Directory', + }, + }, + openid => { + credential => { + class => 'OpenID', + extensions => ['http://openid.net/srv/ax/1.0' => + { + ns => 'ax', + uri => 'http://openid.net/srv/ax/1.0', + mode => 'fetch_request', + required => 'email', + 'type.email' => 'http://axschema.org/contact/email', + # type => { + # email => 'http://axschema.org/contact/email' + # } + } + ], + }, + store => { + class => 'Model::KiokuDB', + model_name => 'Directory', + }, + auto_create_user => 1, + }, + }, + ## Auth with CatalystX::Controller::Auth + 'Controller::Users' => { + model => 'User', + login_id_field => 'username', + login_db_field => 'username', + action_after_login => '/index', + send_register_email => 0, + realm => 'default', + login_fields => { openid => [qw/openid_identifier/], + default => [qw/username password remember/], + }, + }, ); # Start the application