3 package Catalyst::Plugin::Authentication::User::Hash;
4 use base qw/Catalyst::Plugin::Authentication::User/;
17 ( my $key ) = ( our $AUTOLOAD =~ m/([^:]*)$/ );
19 $self->{$key} = shift if @_;
25 clear => ["password"],
26 crypted => ["crypted_password"],
27 hashed => [qw/hashed_password hash_algorithm/],
33 my ( $self, @spec ) = @_;
35 my $cursor = \%features;
37 # traverse the feature list,
39 die "bad feature spec: @spec"
40 if ref($cursor) ne "HASH"
41 or !ref( $cursor = $cursor->{$_} );
44 die "bad feature spec: @spec" unless ref $cursor eq "ARRAY";
46 # check that all the keys required for a feature are in here
47 foreach my $key (@$cursor) {
48 return undef unless exists $self->{$key};
57 return $self; # let's hope we're serialization happy
61 my ( $self, $c, $user ) = @_;
63 return $user; # if we're serialization happy this should work
74 Catalyst::Plugin::Authentication::User::Hash - An easy authentication user
75 object based on hashes.
79 use Catalyst::Plugin::Authentication::User::Hash;
81 Catalyst::Plugin::Authentication::User::Hash->new(
87 This implementation of authentication user handles is supposed to go hand in
88 hand with L<Catalyst::Plugin::Authentication::Store::Minimal>.
96 Create a new object with the key-value-pairs listed in the arg list.
100 Checks for existence of keys that correspond with features.
104 Just returns $self, expecting it to be serializable.
108 Just passes returns the unserialized object, hoping it's intact.
112 Accessor for the key whose name is the method.