Support email-attribute fetching from OpenID
[scpubgit/stemmaweb.git] / lib / stemmaweb.pm
CommitLineData
b8a92065 1package stemmaweb;
2use Moose;
3use namespace::autoclean;
4
5use Catalyst::Runtime 5.80;
6
16562d80 7use Search::GIN::Extract::Class;
8use Search::GIN::Extract::Attributes;
9use Search::GIN::Extract::Multiplex;
10
b8a92065 11# Set flags and add plugins for the application.
12#
13# Note that ORDERING IS IMPORTANT here as plugins are initialized in order,
14# therefore you almost certainly want to keep ConfigLoader at the head of the
15# list if you're using it.
16#
17# -Debug: activates the debug mode for very useful log messages
18# ConfigLoader: will load the configuration from a Config::General file in the
19# application's home directory
20# Static::Simple: will serve static files from the application's root
21# directory
22
23use Catalyst qw/
b8a92065 24 ConfigLoader
25 Static::Simple
26 Unicode::Encoding
16562d80 27 Authentication
28 Session
29 Session::Store::File
30 Session::State::Cookie
19262e3d 31 StatusMessage
b8a92065 32/;
33
34extends 'Catalyst';
35
36our $VERSION = '0.01';
37
38# Configure the application.
39#
40# Note that settings in stemmaweb.conf (or other external
41# configuration file that you set up manually) take precedence
42# over this when using ConfigLoader. Thus configuration
43# details given here can function as a default configuration,
44# with an external configuration file acting as an override for
45# local deployment.
46
47__PACKAGE__->config(
48 name => 'stemmaweb',
49 # Disable deprecated behavior needed by old applications
50 disable_component_resolution_regex_fallback => 1,
51 default_view => 'TT',
52 'View::JSON' => {
53 expose_stash => 'result',
54 },
43ad4ba4 55 'View::TT' => {
56 INCLUDE_PATH => [
57 stemmaweb->path_to( 'root', 'src' ),
58 ],
59 },
16562d80 60 ## kiokudb auth store testing
61 'Plugin::Authentication' => {
62 default => {
63 credential => {
64 class => 'Password',
65 password_field => 'password',
66 password_type => 'self_check',
67 },
68 store => {
69 class => 'Model::KiokuDB',
5a9859b7 70 model_name => 'Directory',
16562d80 71 },
19262e3d 72 },
73 openid => {
74 credential => {
75 class => 'OpenID',
51cece70 76 extensions => ['http://openid.net/srv/ax/1.0' =>
77 {
78 ns => 'ax',
79 uri => 'http://openid.net/srv/ax/1.0',
80 mode => 'fetch_request',
81 required => 'email',
bafbd9ae 82 'type.email' => 'http://axschema.org/contact/email',
83 # type => {
84 # email => 'http://axschema.org/contact/email'
85 # }
51cece70 86 }
87 ],
19262e3d 88 },
89 store => {
90 class => 'Model::KiokuDB',
1412c8fc 91 model_name => 'Directory',
19262e3d 92 },
93 auto_create_user => 1,
94 },
95 },
96 ## Auth with CatalystX::Controller::Auth
97 'Controller::Users' => {
98 model => 'User',
99 login_id_field => 'username',
100 login_db_field => 'username',
101 action_after_login => '/index',
102 send_register_email => 0,
103 realm => 'openid',
75daf982 104 login_fields => { openid => [qw/openid_identifier/],
19262e3d 105 default => [qw/username password/],
106 },
16562d80 107 },
b8a92065 108);
109
110# Start the application
111__PACKAGE__->setup();
112
113
114=head1 NAME
115
116stemmaweb - Catalyst based application
117
118=head1 SYNOPSIS
119
120 script/stemmaweb_server.pl
121
122=head1 DESCRIPTION
123
124[enter your description here]
125
126=head1 SEE ALSO
127
128L<stemmaweb::Controller::Root>, L<Catalyst>
129
130=head1 AUTHOR
131
132Tara L Andrews
133
134=head1 LICENSE
135
136This library is free software. You can redistribute it and/or modify
137it under the same terms as Perl itself.
138
139=cut
140
1411;