Changes to Authentication to support Authentication::Store::Htpasswd
[catagits/Catalyst-Plugin-Authentication.git] / lib / Catalyst / Plugin / Authentication / User.pm
CommitLineData
06675d2e 1#!/usr/bin/perl
2
3package Catalyst::Plugin::Authentication::User;
4
5use strict;
6use warnings;
7
8sub id { die "virtual" }
9
10sub store { die "virtual" }
11
6c8b6e5e 12sub supports {
13 my ( $self, @spec ) = @_;
14
15 my $cursor = $self->supported_features;
16
17 # traverse the feature list,
18 for (@spec) {
19 die "bad feature spec: @spec" if ref($cursor) ne "HASH";
20
21 $cursor = $cursor->{$_};
22 }
23
24 return $cursor;
25}
06675d2e 26
27__PACKAGE__;
28
29__END__
30
31=pod
32
33=head1 NAME
34
35Catalyst::Plugin::Authentication::User - Base class for user objects.
36
37=head1 SYNOPSIS
38
39 package MyStore::User;
40 use base qw/Catalyst::Plugin::Authentication::User/;
41
42=head1 DESCRIPTION
43
44This is the base class for authenticated
45
46=head1 METHODS
47
48=over 4
49
50=item id
51
52A unique ID by which a user can be retrieved from the store.
53
54=item store
55
56Should return a class name that can be used to refetch the user using it's
57ID.
58
59=item supports
60
61An introspection method used to determine what features a user object has, to support credential and authorization plugins.
62
63=item
64
65=back
66
67=cut
68
69