r10518@t0mlaptop (orig r10517): t0m | 2009-06-12 11:27:58 +0100
Tomas Doran [Thu, 9 Sep 2010 22:56:54 +0000 (22:56 +0000)]
 Make error more useful
 r10589@t0mlaptop (orig r10588):  t0m | 2009-06-19 16:14:16 +0100
 Make Credential::Remote have a username_field config option
 r10590@t0mlaptop (orig r10589):  t0m | 2009-06-19 16:16:43 +0100
 Bump versions for release
 r10728@t0mlaptop (orig r10727):  t0m | 2009-06-29 17:55:35 +0100
 Fix issue if you have auth store plugins before authentication plugin
 r10769@t0mlaptop (orig r10768):  t0m | 2009-07-01 17:42:46 +0100
 Checking in changes prior to tagging of version 0.10014.  Changelog diff is:

 Index: Changes
 ===================================================================
 --- Changes (revision 10727)
 +++ Changes (working copy)
 @@ -1,5 +1,6 @@
  Revision history for Perl extension Catalyst::Plugin::Authentication

 +0.10014 Wed Jul  1 17:40:38 BST 2009
        - Make auth_realms method ensure authentication is initialized
          before calling methods which get created during auth initialization.
          Fixes back compat cases where auth store is in the plugin list

 r11234@t0mlaptop (orig r11233):  t0m | 2009-08-24 14:30:51 +0100
 Stop forcing $authinfo->{id} to be passed down to the store, instead using just configurable username_field.
 r11241@t0mlaptop (orig r11240):  t0m | 2009-08-25 15:27:40 +0100
 Change default username_field back to 'username', as this fits in better with the DBIC store / SimpleDB / tutorial / preexisting documentation etc
 r11243@t0mlaptop (orig r11242):  t0m | 2009-08-25 15:45:30 +0100
 Checking in changes prior to tagging of version 0.10014.  Changelog diff is:

 Index: Changes
 ===================================================================
 --- Changes (revision 11232)
 +++ Changes (working copy)
 @@ -1,6 +1,11 @@
  Revision history for Perl extension Catalyst::Plugin::Authentication

 -0.10014 Wed Jul  1 17:40:38 BST 2009
 +0.10014 Tue Aug 25 15:42:57 BST 2009
 +
 +      - Don't always supply an "id" column in the authinfo passed to the store
 +        class in ::Credential::Remote. This means that it works better with
 +        the DBIC store. (t0m)
 +
        - Make auth_realms method ensure authentication is initialized
          before calling methods which get created during auth initialization.
          Fixes back compat cases where auth store is in the plugin list

 r11276@t0mlaptop (orig r11275):  t0m | 2009-09-01 01:49:39 +0100
 Checking in changes prior to tagging of version 0.10015.  Changelog diff is:

 Index: Changes
 ===================================================================
 --- Changes (revision 11261)
 +++ Changes (working copy)
 @@ -1,5 +1,12 @@
  Revision history for Perl extension Catalyst::Plugin::Authentication

 +0.10015 Tue Sep 1 01:40:36 BST 2009
 +
 +     - Remove (undeclared) dependency on Class::Data::Inhertiable (RT#49086)
 +     - Remove dependency on Test::MockObject
 +     - Fix repository metadata in META.yml / Makefile.PL
 +     - Make POD tests author side only.
 +
  0.10014 Tue Aug 25 15:42:57 BST 2009

        - Don't always supply an "id" column in the authinfo passed to the store

 r11368@t0mlaptop (orig r11338):  t0m | 2009-09-08 08:29:46 +0100
 Small doc fixes
 r11559@t0mlaptop (orig r11524):  t0m | 2009-10-14 01:30:11 +0100
 Change example configs to fit in with recent DBIC store
 r11560@t0mlaptop (orig r11525):  t0m | 2009-10-14 01:34:35 +0100
 If this wasn't a patch in RT, I wouldn't be applying it
 r11571@t0mlaptop (orig r11536):  t0m | 2009-10-15 16:09:14 +0100
 Not needed in BEGIN
 r11572@t0mlaptop (orig r11537):  t0m | 2009-10-15 16:09:37 +0100
 Note here
 r11575@t0mlaptop (orig r11540):  t0m | 2009-10-16 01:50:28 +0100
 Add AUTOLOAD nicked from the dbic store to base class
 r11576@t0mlaptop (orig r11541):  t0m | 2009-10-16 02:28:16 +0100
 Epic cleanup and code shuffle in tests to avoid warnings
 r11628@t0mlaptop (orig r11593):  rafl | 2009-10-17 17:40:51 +0100
 Remove debugging code polluting STDERR.
 r11683@t0mlaptop (orig r11648):  jawnsy | 2009-10-21 02:41:14 +0100
 Bring copyright statement in sync with the other packages
 r12472@t0mlaptop (orig r12437):  rafl | 2009-12-19 23:51:32 +0000
 A bit of clarification - logout does not delete the session.

 semifor++
 r12526@t0mlaptop (orig r12491):  xenoterracide | 2009-12-30 12:59:24 +0000
 minor code example fix in documentation
 r12527@t0mlaptop (orig r12492):  t0m | 2009-12-30 13:04:14 +0000
 Fix hard tabs (by converting to 4 space soft tabs), fix trailing whitespace
 r12545@t0mlaptop (orig r12510):  xenoterracide | 2010-01-03 13:26:12 +0000
 Clean up documentation errors
 r12745@t0mlaptop (orig r12710):  stephan48 | 2010-01-22 21:30:20 +0000
 Fixed RT Bug 47106; Code used the wrong Object to Retrieve authinfo_munge
 r12746@t0mlaptop (orig r12711):  rafl | 2010-01-22 21:34:14 +0000
 Some formatting and whitespace tweaks.
 r12747@t0mlaptop (orig r12712):  rafl | 2010-01-22 21:44:55 +0000
 Clean up some more tabs and whitespaces.
 r12748@t0mlaptop (orig r12713):  rafl | 2010-01-22 21:45:01 +0000
 Prepare release.
 r12749@t0mlaptop (orig r12714):  rafl | 2010-01-22 21:50:39 +0000
 Add .gitignore.
 r12750@t0mlaptop (orig r12715):  rafl | 2010-01-22 21:50:43 +0000
 Ignore git files from MANIFEST.
 r12751@t0mlaptop (orig r12716):  rafl | 2010-01-22 21:50:49 +0000
 Port from NEXT to C3.

 Also clean up more silly whitespace.
 r12752@t0mlaptop (orig r12717):  rafl | 2010-01-22 21:50:55 +0000
 Version 0.10016.
 r12754@t0mlaptop (orig r12719):  rafl | 2010-01-22 21:55:20 +0000
 Add a NoTabs test and make it pass.
 r12916@t0mlaptop (orig r12880):  jawnsy | 2010-02-15 23:36:41 +0000
 fix typos Debian picked up
 r13054@t0mlaptop (orig r13018):  t0m | 2010-03-07 20:56:42 +0000
 Date in changes
 r13082@t0mlaptop (orig r13046):  xenoterracide | 2010-03-17 22:52:21 +0000
 Make debug message clear for users of progressive realms
 r13132@t0mlaptop (orig r13096):  rafl | 2010-03-29 14:58:42 +0100
 Fix syntax error.

1  2 
Makefile.PL
lib/Catalyst/Authentication/Credential/Password.pm
lib/Catalyst/Authentication/Realm/Progressive.pm
lib/Catalyst/Authentication/Store/Minimal.pm
lib/Catalyst/Authentication/User.pm
lib/Catalyst/Plugin/Authentication.pm

diff --cc Makefile.PL
Simple merge
@@@ -6,16 -9,17 +6,17 @@@ use Scalar::Util        ()
  use Catalyst::Exception ();
  use Digest              ();
  
 -__PACKAGE__->mk_accessors(qw/_config realm/);
 +has [qw/_config realm/] => ( is => 'rw' );
  
 -sub new {
 +sub BUILDARGS {
      my ($class, $config, $app, $realm) = @_;
-     
+     # Note _config is horrible back compat hackery!
 -    my $self = { _config => $config };
 -    bless $self, $class;
 -    
 -    $self->realm($realm);
 -    
 +    { realm => $realm, _config => $config };
 +}
 +
 +sub BUILD {
 +    my ($self, $args) = @_;    
      $self->_config->{'password_field'} ||= 'password';
      $self->_config->{'password_type'}  ||= 'clear';
      $self->_config->{'password_hash_type'} ||= 'SHA-1';
@@@ -1,9 -1,12 +1,10 @@@
  package Catalyst::Authentication::User;
 -
 -use strict;
 -use warnings;
 -use base qw/Class::Accessor::Fast/;
 +use Moose;
+ use Scalar::Util qw/refaddr/;
 +use namespace::autoclean;
  
  ## auth_realm is the realm this user came from. 
 -__PACKAGE__->mk_accessors(qw/auth_realm store/);
 +has [qw/auth_realm store/] => ( is => 'rw' );
  
  ## THIS IS NOT A COMPLETE CLASS! it is intended to provide base functionality only.  
  ## translation - it won't work if you try to use it directly.
@@@ -67,15 -70,19 +68,13 @@@ sub obj 
      return $self->get_object(@_);
  }
  
- ## Backwards Compatibility
- ## you probably want auth_realm, in fact.  but this does work for backwards compatibility.
- ## store should be a read-write accessor - so it was moved to mk_accessors
- ##sub store { 
- ##    my ($self) = @_;
- ##    return $self->auth_realm->{store};
- ##}
+ sub AUTOLOAD {
+     my $self = shift;
+     (my $method) = (our $AUTOLOAD =~ /([^:]+)$/);
+     return if $method eq "DESTROY";
  
 -    my $obj = $self->obj;
 -    # Don't bother unless we have a backing object
 -    return if refaddr($obj) eq refaddr($self);
 -
 -    $obj->$method(@_);
 -}
 -
 +__PACKAGE__->meta->make_immutable;
+ __PACKAGE__;
  
  __END__
  
@@@ -4,11 -11,8 +4,11 @@@ use MRO::Compat
  use Tie::RefHash;
  use Class::Inspector;
  use Catalyst::Authentication::Realm;
 +use namespace::autoclean;
 +
 +has _user => ( is => 'rw' );
  
- our $VERSION = "0.10012";
+ our $VERSION = "0.10016";
  
  sub set_authenticated {
      my ( $c, $user, $realmname ) = @_;