File Coverage

blib/lib/Catalyst/Authentication/Store/Null.pm
Criterion Covered Total %
statement 13 19 68.4
branch n/a
condition n/a
subroutine 5 8 62.5
pod 5 5 100.0
total 23 32 71.8


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