Commit | Line | Data |
5c5af345 |
1 | package Catalyst::Authentication::Store::Null; |
f05e1d28 |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
5c5af345 |
6 | use Catalyst::Authentication::User::Hash; |
f05e1d28 |
7 | |
8 | use base qw( Class::Accessor::Fast ); |
9 | |
10 | BEGIN { |
106913db |
11 | __PACKAGE__->mk_accessors( qw( _config ) ); |
f05e1d28 |
12 | } |
13 | |
14 | sub new { |
5afc0dde |
15 | my ( $class, $config, $app, $realm ) = @_; |
106913db |
16 | bless { _config => $config }, $class; |
f05e1d28 |
17 | } |
18 | |
19 | sub for_session { |
20 | my ( $self, $c, $user ) = @_; |
21 | return $user; |
22 | } |
23 | |
24 | sub from_session { |
25 | my ( $self, $c, $user ) = @_; |
26 | return $user; |
27 | } |
28 | |
29 | sub find_user { |
30 | my ( $self, $userinfo, $c ) = @_; |
5c5af345 |
31 | return bless $userinfo, 'Catalyst::Authentication::User::Hash'; |
f05e1d28 |
32 | } |
33 | |
34 | sub user_supports { |
35 | my $self = shift; |
5c5af345 |
36 | Catalyst::Authentication::User::Hash->supports(@_); |
f05e1d28 |
37 | } |
38 | |
39 | 1; |
55fa99fd |
40 | |
41 | __END__ |
42 | |
43 | =pod |
44 | |
45 | =head1 NAME |
46 | |
5c5af345 |
47 | Catalyst::Authentication::Store::Null - Null authentication store |
55fa99fd |
48 | |
49 | =head1 SYNOPSIS |
50 | |
51 | use Catalyst qw( |
52 | Authentication |
53 | ); |
54 | |
c83ea211 |
55 | __PACKAGE__->config( 'Plugin::Authentication' => { |
55fa99fd |
56 | default_realm => 'remote', |
57 | realms => { |
58 | remote => { |
59 | credential => { |
60 | class => 'TypeKey', |
61 | key_url => 'http://example.com/regkeys.txt', |
62 | }, |
63 | store => { |
64 | class => 'Null', |
65 | } |
66 | } |
67 | } |
c83ea211 |
68 | }); |
55fa99fd |
69 | |
70 | =head1 DESCRIPTION |
71 | |
72 | The Null store is a transparent store where any supplied user data is |
73 | accepted. This is mainly useful for remotely authenticating credentials |
74 | (e.g. TypeKey, OpenID) which may not be tied to any local storage. It also |
75 | helps facilitate integration with the Session plugin. |
76 | |
77 | =head1 METHODS |
78 | |
79 | =head2 new( ) |
80 | |
81 | Creates a new instance of the store. |
82 | |
83 | =head2 for_session( ) |
84 | |
85 | Returns the user object passed to the method. |
86 | |
87 | =head2 from_session( ) |
88 | |
89 | Returns the user object passed to the method. |
90 | |
91 | =head2 find_user( ) |
92 | |
93 | Since this store isn't tied to any real set of users, this method just returns |
5c5af345 |
94 | the user info bless as a L<Catalyst::Authentication::User::Hash> |
55fa99fd |
95 | object. |
96 | |
97 | =head2 user_supports( ) |
98 | |
5c5af345 |
99 | Delegates to L<Catalyst::Authentication::User::Hash>. |
55fa99fd |
100 | |
101 | =cut |