| 1 | package Net::OpenID::JanRain::Consumer::Stores::DumbStore; | ||
| 2 | |||
| 3 | # vi:ts=4:sw=4 | ||
| 4 | |||
| 5 | use warnings; | ||
| 6 | use strict; | ||
| 7 | |||
| 8 | use Carp; | ||
| 9 | use Digest::SHA1 qw(sha1); | ||
| 10 | |||
| 11 | use base qw(Net::OpenID::JanRain::Consumer::Stores); | ||
| 12 | |||
| 13 | sub new { | ||
| 14 | my $caller = shift; | ||
| 15 | my ($secret_phrase) = @_; | ||
| 16 | my $class = ref($caller) || $caller; | ||
| 17 | my $self = { | ||
| 18 | auth_key => sha1($secret_phrase), | ||
| 19 | }; | ||
| 20 | bless($self, $class); | ||
| 21 | return($self); | ||
| 22 | } # end new | ||
| 23 | |||
| 24 | ######################################################################## | ||
| 25 | use constant { # constant, method, accessor. meh. | ||
| 26 | # all of these just return undef | ||
| 27 | storeAssociation => undef(), | ||
| 28 | getAssociation => undef(), | ||
| 29 | removeAssociation => undef(), | ||
| 30 | storeNonce => undef(), | ||
| 31 | # and these are true | ||
| 32 | useNonce => 1, | ||
| 33 | isDumb => 1, | ||
| 34 | }; | ||
| 35 | ######################################################################## | ||
| 36 | |||
| 37 | sub getAuthKey { | ||
| 38 | my $self = shift; | ||
| 39 | return($self->{auth_key}); | ||
| 40 | } # end getAuthKey | ||
| 41 | ######################################################################## | ||
| 42 | |||
| 43 | 1; |