From: Yuval Kogman Date: Sun, 27 Nov 2005 17:47:04 +0000 (+0000) Subject: Lots of doc for C::P::Authentication X-Git-Tag: v0.01~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4fbe2e14e7e9bc91be1af92ce7b119373c1c808c;hp=4402d92dd338ad2ffcb98a6f2c235dcde0ee81cb;p=catagits%2FCatalyst-Plugin-Authentication.git Lots of doc for C::P::Authentication --- diff --git a/lib/Catalyst/Plugin/Authentication.pm b/lib/Catalyst/Plugin/Authentication.pm index e34d3a7..1355eff 100644 --- a/lib/Catalyst/Plugin/Authentication.pm +++ b/lib/Catalyst/Plugin/Authentication.pm @@ -30,7 +30,7 @@ sub set_authenticated { $c->save_user_in_session($user); } - $c->NEXT::set_authenticated( $user ); + $c->NEXT::set_authenticated($user); } sub user { @@ -85,7 +85,7 @@ sub get_user { sub prepare { my $c = shift->NEXT::prepare(@_); - if ( $c->isa("Catalyst::Plugin::Session") + if ( $c->isa("Catalyst::Plugin::Session") and !$c->user ) { if ( $c->sessionid and my $frozen_user = $c->session->{__user} ) { @@ -99,7 +99,10 @@ sub prepare { sub auth_restore_user { my ( $c, $frozen_user, $store_name ) = @_; - return unless $c->isa("Catalyst::PLugin::Session") and $c->config->{authentication}{use_session} and $c->sessionid; + return + unless $c->isa("Catalyst::PLugin::Session") + and $c->config->{authentication}{use_session} + and $c->sessionid; $store_name ||= $c->session->{__user_store}; $frozen_user ||= $c->session->{__user}; @@ -160,7 +163,7 @@ sub auth_store_names { $self->_auth_store_names || do { tie my %hash, 'Tie::RefHash'; $self->_auth_store_names( \%hash ); - } + } } sub default_auth_store { @@ -216,11 +219,41 @@ Delete the currently logged in user from C and the session. Delegate C to the default store. +=back + +=head1 METHODS FOR STORE MANAGEMENT + =item default_auth_store -Returns C<< $c->config->{authentication}{store} >>. +Return the store whose name is 'default'. -=back +This is set to C<<$c->config->{authentication}{store}>> if that value exists, +or by using a Store plugin: + + use Catalyst qw/Authentication Authentication::Store::Minimal/; + +Sets the default store to +L. + +=item get_auth_store $name + +Return the store whose name is $name. + +=item get_auth_store_name $store + +Return the name of the store $store. + +=item auth_stores + +A hash keyed by name, with the stores registered in the app. + +=item auth_store_names + +A ref-hash keyed by store, which contains the names of the stores. + +=item register_auth_stores %stores_by_name + +Register stores into the application. =head1 INTERNAL METHODS diff --git a/lib/Catalyst/Plugin/Authentication/Store/Minimal/Backend.pm b/lib/Catalyst/Plugin/Authentication/Store/Minimal/Backend.pm index b82261f..540b4d7 100644 --- a/lib/Catalyst/Plugin/Authentication/Store/Minimal/Backend.pm +++ b/lib/Catalyst/Plugin/Authentication/Store/Minimal/Backend.pm @@ -121,6 +121,10 @@ Keys the hash by $id and returns the value. If the return value is unblessed it will be blessed as L. +=item from_session $id + +Delegates to C. + =item user_supports Chooses a random user from the hash and delegates to it. diff --git a/lib/Catalyst/Plugin/Authentication/User/Hash.pm b/lib/Catalyst/Plugin/Authentication/User/Hash.pm index db1783e..fadca7e 100644 --- a/lib/Catalyst/Plugin/Authentication/User/Hash.pm +++ b/lib/Catalyst/Plugin/Authentication/User/Hash.pm @@ -140,6 +140,12 @@ Just passes returns the unserialized object, hoping it's intact. Accessor for the key whose name is the method. +=item id + +=item store + +Accessors that override superclass's dying virtual methods. + =back =head1 SEE ALSO