Revision history for Perl extension Catalyst::Plugin::Authentication
+ - Change all classes to Moose and MooseX::Emulate::Class::Accessor::Fast,
+ fixing undeclared dependency on Class::Accessor::Fast.
- Change Catalyst::Authentication::Realm to use String::RewritePrefix
rather than doing namespace mangling manually.
- Fix whitespace and tabs, add Test::EOL and Test::NoTabs
requires 'Catalyst::Plugin::Session' => '0.10';
requires 'Moose';
requires 'MooseX::Emulate::Class::Accessor::Fast';
-requires 'namespace::clean';
+requires 'namespace::autoclean';
requires 'String::RewritePrefix';
requires 'Try::Tiny';
package Catalyst::Authentication::Credential::Password;
+use Moose;
+use namespace::autoclean;
-use strict;
-use warnings;
-
-use base qw/Class::Accessor::Fast/;
+with 'MooseX::Emulate::Class::Accessor::Fast';
use Scalar::Util ();
use Catalyst::Exception ();
package Catalyst::Authentication::Credential::Remote;
+use Moose;
+use namespace::autoclean;
-use strict;
-use warnings;
-use Try::Tiny qw/ try catch /;
+with 'MooseX::Emulate::Class::Accessor::Fast';
-use base 'Class::Accessor::Fast';
+use Try::Tiny qw/ try catch /;
-BEGIN {
- __PACKAGE__->mk_accessors(
- qw/allow_re deny_re cutname_re source realm username_field/);
-}
+__PACKAGE__->mk_accessors(
+ qw/allow_re deny_re cutname_re source realm username_field/);
sub new {
my ( $class, $config, $app, $realm ) = @_;
package Catalyst::Authentication::Realm;
+use Moose;
+use namespace::autoclean;
-use strict;
-use warnings;
+with 'MooseX::Emulate::Class::Accessor::Fast';
use String::RewritePrefix;
use Try::Tiny qw/ try catch /;
-use base qw/Class::Accessor::Fast/;
-
-BEGIN {
- __PACKAGE__->mk_accessors(qw/store credential name config/);
-};
+__PACKAGE__->mk_accessors(qw/store credential name config/);
## Add use_session config item to realm.
package Catalyst::Authentication::Store::Minimal;
+use Moose;
+use namespace::autoclean;
-use strict;
-use warnings;
-
+with 'MooseX::Emulate::Class::Accessor::Fast';
use Scalar::Util qw( blessed );
-use base qw/Class::Accessor::Fast/;
-BEGIN {
- __PACKAGE__->mk_accessors(qw/userhash userclass/);
-}
+__PACKAGE__->mk_accessors(qw/userhash userclass/);
sub new {
my ( $class, $config, $app, $realm) = @_;
package Catalyst::Authentication::Store::Null;
+use Moose;
+use namespace::autoclean;
-use strict;
-use warnings;
+with 'MooseX::Emulate::Class::Accessor::Fast';
use Catalyst::Authentication::User::Hash;
-use base qw( Class::Accessor::Fast );
-
-BEGIN {
- __PACKAGE__->mk_accessors( qw( _config ) );
-}
+__PACKAGE__->mk_accessors( qw( _config ) );
sub new {
my ( $class, $config, $app, $realm ) = @_;
package Catalyst::Authentication::User;
+use Moose;
+use namespace::autoclean;
-use strict;
-use warnings;
-use base qw/Class::Accessor::Fast/;
+with 'MooseX::Emulate::Class::Accessor::Fast';
use Scalar::Util qw/refaddr/;
-## auth_realm is the realm this user came from.
+## auth_realm is the realm this user came from.
__PACKAGE__->mk_accessors(qw/auth_realm store/);
-## THIS IS NOT A COMPLETE CLASS! it is intended to provide base functionality only.
+## 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.
## chances are you want to override this.
sub id { shift->get('id'); }
-## this relies on 'supported_features' being implemented by the subclass..
-## but it is not an error if it is not. it just means you support nothing.
+## this relies on 'supported_features' being implemented by the subclass..
+## but it is not an error if it is not. it just means you support nothing.
## nihilist user objects are welcome here.
sub supports {
my ( $self, @spec ) = @_;
$cursor = $cursor->{$_};
}
- }
+ }
return $cursor;
}
}
## REQUIRED.
-## get_object should return the underlying user object. This is for when more advanced uses of the
+## get_object should return the underlying user object. This is for when more advanced uses of the
## user is required. Modifications to the existing user, etc. Changes in the object returned
## by this routine may not be reflected in the C::P::A::User object - if this is required, re-authenticating
## the user is probably the best route to take.
return shift;
}
-## obj is shorthand for get_object. This is originally from the DBIx::Class store, but
+## obj is shorthand for get_object. This is originally from the DBIx::Class store, but
## as it has become common usage, this makes things more compatible. Plus, it's shorter.
sub obj {
my $self = shift;