[Catalyst-commits] r14055 - in trunk/Catalyst-Plugin-Authentication-Store-DBIC: . lib/Catalyst/Plugin/Authentication/Store lib/Catalyst/Plugin/Authentication/Store/DBIC lib/Catalyst/Plugin/Authentication/Store/DBIC/User t t/lib t/lib/TestApp t/lib/TestApp/Controller

jnapiorkowski at dev.catalyst.perl.org jnapiorkowski at dev.catalyst.perl.org
Sat Jul 30 17:34:01 GMT 2011


Author: jnapiorkowski
Date: 2011-07-30 17:34:01 +0000 (Sat, 30 Jul 2011)
New Revision: 14055

Added:
   trunk/Catalyst-Plugin-Authentication-Store-DBIC/t/lib/TestApp/Controller/
   trunk/Catalyst-Plugin-Authentication-Store-DBIC/t/lib/TestApp/Controller/Root.pm
Modified:
   trunk/Catalyst-Plugin-Authentication-Store-DBIC/Changes
   trunk/Catalyst-Plugin-Authentication-Store-DBIC/Makefile.PL
   trunk/Catalyst-Plugin-Authentication-Store-DBIC/lib/Catalyst/Plugin/Authentication/Store/DBIC.pm
   trunk/Catalyst-Plugin-Authentication-Store-DBIC/lib/Catalyst/Plugin/Authentication/Store/DBIC/User.pm
   trunk/Catalyst-Plugin-Authentication-Store-DBIC/lib/Catalyst/Plugin/Authentication/Store/DBIC/User/CDBI.pm
   trunk/Catalyst-Plugin-Authentication-Store-DBIC/t/10authz-dbic-schema.t
   trunk/Catalyst-Plugin-Authentication-Store-DBIC/t/lib/TestApp.pm
Log:
updates to fix deprecations alerts and test issues with such an old module

Modified: trunk/Catalyst-Plugin-Authentication-Store-DBIC/Changes
===================================================================
--- trunk/Catalyst-Plugin-Authentication-Store-DBIC/Changes	2011-07-29 08:13:04 UTC (rev 14054)
+++ trunk/Catalyst-Plugin-Authentication-Store-DBIC/Changes	2011-07-30 17:34:01 UTC (rev 14055)
@@ -1,5 +1,10 @@
 Revision history for Perl extension Catalyst::Plugin::Authentication::Store::DBIC
 
+0.12 2011-07-30
+    - convert to MRO::Compat from NEXT
+    - pod fixes and related changes to silence test warnings
+
+
 0.11 2008-07-16
     - Make deprecation notice point to the right damn module
       (Catalyst::Authentication::Store::DBIx::Class)

Modified: trunk/Catalyst-Plugin-Authentication-Store-DBIC/Makefile.PL
===================================================================
--- trunk/Catalyst-Plugin-Authentication-Store-DBIC/Makefile.PL	2011-07-29 08:13:04 UTC (rev 14054)
+++ trunk/Catalyst-Plugin-Authentication-Store-DBIC/Makefile.PL	2011-07-30 17:34:01 UTC (rev 14055)
@@ -9,6 +9,7 @@
 requires 'Class::Accessor::Fast';
 requires 'DBIx::Class';
 requires 'Catalyst::Model::DBIC::Schema';
+requires 'MRO::Compat';
 
 feature 'Roles support',
     -default                                 => 1,

Modified: trunk/Catalyst-Plugin-Authentication-Store-DBIC/lib/Catalyst/Plugin/Authentication/Store/DBIC/User/CDBI.pm
===================================================================
--- trunk/Catalyst-Plugin-Authentication-Store-DBIC/lib/Catalyst/Plugin/Authentication/Store/DBIC/User/CDBI.pm	2011-07-29 08:13:04 UTC (rev 14054)
+++ trunk/Catalyst-Plugin-Authentication-Store-DBIC/lib/Catalyst/Plugin/Authentication/Store/DBIC/User/CDBI.pm	2011-07-30 17:34:01 UTC (rev 14055)
@@ -46,4 +46,20 @@
     return @roles;
 }
 
+=head1 NAME
+
+Catalyst::Plugin::Authentication::Store::DBIC::User::CDBI - Deprecated Catalyst Authentication
+
+=head1 DEPRECATED
+
+This store has been deprecated in favour of 
+L<Catalyst::Authentication::Store::DBIx::Class>. Please do not use 
+this plugin for new development.
+
+=head1 METHODS
+
+=head2 store_session_data
+
+=cut
+
 1;

Modified: trunk/Catalyst-Plugin-Authentication-Store-DBIC/lib/Catalyst/Plugin/Authentication/Store/DBIC/User.pm
===================================================================
--- trunk/Catalyst-Plugin-Authentication-Store-DBIC/lib/Catalyst/Plugin/Authentication/Store/DBIC/User.pm	2011-07-29 08:13:04 UTC (rev 14054)
+++ trunk/Catalyst-Plugin-Authentication-Store-DBIC/lib/Catalyst/Plugin/Authentication/Store/DBIC/User.pm	2011-07-30 17:34:01 UTC (rev 14055)
@@ -190,6 +190,16 @@
 
 =head2 for_session
 
+=head2 canonical_id
+
+=head2 get_session_data
+
+=head2 obj
+
+=head2 store_session_data
+
+=head2 user
+
 =head1 SEE ALSO
 
 L<Catalyst::Plugin::Authentication::Store::DBIC>

Modified: trunk/Catalyst-Plugin-Authentication-Store-DBIC/lib/Catalyst/Plugin/Authentication/Store/DBIC.pm
===================================================================
--- trunk/Catalyst-Plugin-Authentication-Store-DBIC/lib/Catalyst/Plugin/Authentication/Store/DBIC.pm	2011-07-29 08:13:04 UTC (rev 14054)
+++ trunk/Catalyst-Plugin-Authentication-Store-DBIC/lib/Catalyst/Plugin/Authentication/Store/DBIC.pm	2011-07-30 17:34:01 UTC (rev 14055)
@@ -3,10 +3,11 @@
 use strict;
 use warnings;
 
-our $VERSION = '0.11';
+our $VERSION = '0.12';
 
 use Catalyst::Plugin::Authentication::Store::DBIC::Backend;
 use Catalyst::Utils ();
+use MRO::Compat;
 
 sub setup {
     my $c = shift;
@@ -27,7 +28,7 @@
         } )
     );
 
-    $c->NEXT::setup(@_);
+    $c->maybe::next::method(@_);
 }
 
 sub setup_finished {
@@ -61,7 +62,7 @@
         $config->{authz}{user_role_class} = _get_instance( $c, $user_role_class );
     }
 
-    $c->NEXT::setup_finished(@_);
+    $c->maybe::next::method(@_);
 }
 
 sub _get_instance {
@@ -313,6 +314,10 @@
 still work, but are no longer recommended. The new API is cleaner and easier
 to use.
 
+=head2 user_object
+
+See L</obj> for information on this no longer recommended method.
+.
 =head1 INTERNAL METHODS
 
 =head2 setup

Modified: trunk/Catalyst-Plugin-Authentication-Store-DBIC/t/10authz-dbic-schema.t
===================================================================
--- trunk/Catalyst-Plugin-Authentication-Store-DBIC/t/10authz-dbic-schema.t	2011-07-29 08:13:04 UTC (rev 14054)
+++ trunk/Catalyst-Plugin-Authentication-Store-DBIC/t/10authz-dbic-schema.t	2011-07-30 17:34:01 UTC (rev 14055)
@@ -44,7 +44,7 @@
         },
         authorization => {
             dbic => {
-                role_class           => 'TestApp::Model::DBICSchema::Role',
+                role_class           => 'DBICSchema::Role',
                 role_field           => 'role',
                 role_rel             => 'map_user_role',
                 user_role_user_field => 'user',

Added: trunk/Catalyst-Plugin-Authentication-Store-DBIC/t/lib/TestApp/Controller/Root.pm
===================================================================
--- trunk/Catalyst-Plugin-Authentication-Store-DBIC/t/lib/TestApp/Controller/Root.pm	                        (rev 0)
+++ trunk/Catalyst-Plugin-Authentication-Store-DBIC/t/lib/TestApp/Controller/Root.pm	2011-07-30 17:34:01 UTC (rev 14055)
@@ -0,0 +1,93 @@
+package TestApp::Controller::Root;
+
+use strict;
+use warnings;
+use Data::Dumper;
+use base 'Catalyst::Controller';
+
+__PACKAGE__->config({ namespace => '' });
+
+sub user_login : Global {
+    my ( $self, $c ) = @_;
+
+    $c->login;
+
+    if ( $c->user_exists ) {
+        if ( $c->req->params->{detach} ) {
+            $c->detach( $c->req->params->{detach} );
+        }
+        $c->res->body( 'logged in' );
+    }
+    else {
+        $c->res->body( 'not logged in' );
+    }
+}
+
+sub user_logout : Global {
+    my ( $self, $c ) = @_;
+
+    $c->logout;
+
+    if ( ! $c->user ) {
+        $c->res->body( 'logged out' );
+    }
+    else {
+        $c->res->body( 'not logged ok' );
+    }
+}
+
+sub user_login_session : Global {
+    my ( $self, $c ) = @_;
+
+    if ( $c->req->params->{username} && $c->req->params->{password} ) {
+        $c->login(
+            $c->req->params->{username},
+            $c->req->params->{password}
+        );
+
+        if ( $c->user_exists ) {
+            $c->res->body( $c->session->{__user} );
+        }
+        else {
+            $c->res->body( 'not logged in' );
+        }
+    }
+}
+
+sub get_session_user : Global {
+    my ( $self, $c ) = @_;
+
+    if ( $c->session->{__user} ) {
+        $c->res->body( $c->session->{__user} );
+    }
+}
+
+sub is_admin : Global {
+    my ( $self, $c ) = @_;
+
+    if ( $c->check_user_roles( 'admin' ) ) {
+        $c->res->body( 'ok' );
+    }
+}
+
+sub is_admin_user : Global {
+    my ( $self, $c ) = @_;
+
+    if ( $c->check_user_roles( qw/admin user/ ) ) {
+        $c->res->body( 'ok' );
+    }
+}
+
+sub set_usersession : Global {
+    my ( $self, $c, $value ) = @_;
+    $c->user_session->{foo} = $value;
+    $c->res->body( 'ok' );
+}
+
+sub get_usersession : Global {
+    my ( $self, $c ) = @_;
+    $c->res->body( $c->user_session->{foo} || '' );
+}
+
+1;
+

Modified: trunk/Catalyst-Plugin-Authentication-Store-DBIC/t/lib/TestApp.pm
===================================================================
--- trunk/Catalyst-Plugin-Authentication-Store-DBIC/t/lib/TestApp.pm	2011-07-29 08:13:04 UTC (rev 14054)
+++ trunk/Catalyst-Plugin-Authentication-Store-DBIC/t/lib/TestApp.pm	2011-07-30 17:34:01 UTC (rev 14055)
@@ -8,86 +8,4 @@
 
 TestApp->setup( @{$ENV{TESTAPP_PLUGINS}} );
 
-sub user_login : Global {
-    my ( $self, $c ) = @_;
-
-    $c->login;
-
-    if ( $c->user_exists ) {
-        if ( $c->req->params->{detach} ) {
-            $c->detach( $c->req->params->{detach} );
-        }
-        $c->res->body( 'logged in' );
-    }
-    else {
-        $c->res->body( 'not logged in' );
-    }
-}
-
-sub user_logout : Global {
-    my ( $self, $c ) = @_;
-
-    $c->logout;
-
-    if ( ! $c->user ) {
-        $c->res->body( 'logged out' );
-    }
-    else {
-        $c->res->body( 'not logged ok' );
-    }
-}
-
-sub user_login_session : Global {
-    my ( $self, $c ) = @_;
-
-    if ( $c->req->params->{username} && $c->req->params->{password} ) {
-        $c->login(
-            $c->req->params->{username},
-            $c->req->params->{password}
-        );
-
-        if ( $c->user_exists ) {
-            $c->res->body( $c->session->{__user} );
-        }
-        else {
-            $c->res->body( 'not logged in' );
-        }
-    }
-}
-
-sub get_session_user : Global {
-    my ( $self, $c ) = @_;
-
-    if ( $c->session->{__user} ) {
-        $c->res->body( $c->session->{__user} );
-    }
-}
-
-sub is_admin : Global {
-    my ( $self, $c ) = @_;
-
-    if ( $c->check_user_roles( 'admin' ) ) {
-        $c->res->body( 'ok' );
-    }
-}
-
-sub is_admin_user : Global {
-    my ( $self, $c ) = @_;
-
-    if ( $c->check_user_roles( qw/admin user/ ) ) {
-        $c->res->body( 'ok' );
-    }
-}
-
-sub set_usersession : Global {
-    my ( $self, $c, $value ) = @_;
-    $c->user_session->{foo} = $value;
-    $c->res->body( 'ok' );
-}
-
-sub get_usersession : Global {
-    my ( $self, $c ) = @_;
-    $c->res->body( $c->user_session->{foo} || '' );
-}
-
 1;




More information about the Catalyst-commits mailing list