3 package Catalyst::Plugin::Authentication::User::Hash;
4 use base qw/Catalyst::Plugin::Authentication::User/;
17 ( my $key ) = ( our $AUTOLOAD =~ m/([^:]*)$/ );
20 my $arr = $self->{__hash_obj_key_is_array}{$key} = @_ > 1;
21 $self->{$key} = $arr ? [@_] : shift;
24 my $data = $self->{$key};
25 ( $self->{__hash_obj_key_is_array}{$key} || $key =~ /roles/ )
32 clear => ["password"],
33 crypted => ["crypted_password"],
34 hashed => [qw/hashed_password hash_algorithm/],
42 my ( $self, @spec ) = @_;
44 my $cursor = \%features;
46 # traverse the feature list,
48 die "bad feature spec: @spec"
49 if ref($cursor) ne "HASH";
50 $cursor = $cursor->{$_};
54 die "bad feature spec: @spec" unless ref $cursor eq "ARRAY";
56 # check that all the keys required for a feature are in here
57 foreach my $key (@$cursor) {
58 return undef unless exists $self->{$key};
71 return $self; # let's hope we're serialization happy
75 my ( $self, $c, $user ) = @_;
77 return $user; # if we're serialization happy this should work
88 Catalyst::Plugin::Authentication::User::Hash - An easy authentication user
89 object based on hashes.
93 use Catalyst::Plugin::Authentication::User::Hash;
95 Catalyst::Plugin::Authentication::User::Hash->new(
101 This implementation of authentication user handles is supposed to go hand in
102 hand with L<Catalyst::Plugin::Authentication::Store::Minimal>.
110 Create a new object with the key-value-pairs listed in the arg list.
114 Checks for existence of keys that correspond with features.
118 Just returns $self, expecting it to be serializable.
122 Just passes returns the unserialized object, hoping it's intact.
126 Accessor for the key whose name is the method.