diff -Nru libcatalystx-simplelogin-perl-0.18/Changes libcatalystx-simplelogin-perl-0.19/Changes --- libcatalystx-simplelogin-perl-0.18/Changes 2012-07-21 13:39:17.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/Changes 2016-02-22 17:16:51.000000000 +0000 @@ -1,3 +1,10 @@ +0.19 Mon, 22 February 2016 18:16:00 +0100 + * Remove test dependency on Session::Store::File + * Fix "remember" checkbox (Yaroslav Polyakov) + * Made remember me behaviour extensible and configurable. + * Rotate session id after login/logout + * Catch exceptions thrown by the authenticate method + 0.18 Sat, 21 July 2012 14:39:00 +0100 * Stop depending on the now unused Catalyst::Controller::ActionRole RT#78500 diff -Nru libcatalystx-simplelogin-perl-0.18/debian/changelog libcatalystx-simplelogin-perl-0.19/debian/changelog --- libcatalystx-simplelogin-perl-0.18/debian/changelog 2014-05-19 09:25:02.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/debian/changelog 2016-07-29 18:27:40.000000000 +0000 @@ -1,3 +1,31 @@ +libcatalystx-simplelogin-perl (0.19-1) unstable; urgency=medium + + * Team upload + + [ Salvatore Bonaccorso ] + * Update Vcs-Browser URL to cgit web frontend + * debian/control: Use HTTPS transport protocol for Vcs-Git URI + + [ gregor herrmann ] + * debian/copyright: change Copyright-Format 1.0 URL to HTTPS. + + [ Nick Morrott ] + * Imported Upstream version 0.19 + * Correct typo in package long description + * Update build and runtime dependencies + * Bump debhelper compatibility to version 9 + * Bump Standards-Version to 3.9.8 (no changes) + * Add Testsuite header to make package autopkgtest-able + * Update lintian override (manpage-has-errors-from-man) + * Add 0001-spelling-error-in-manpage.patch + * Add debian/upstream/metadata file + * Add debian/tests/pkg-perl/syntax-skip (OpenID is optional) + + [ gregor herrmann ] + * Update copyright years for inc/Module/Install*. + + -- Nick Morrott Fri, 29 Jul 2016 02:05:29 +0100 + libcatalystx-simplelogin-perl (0.18-2) unstable; urgency=medium * Team upload diff -Nru libcatalystx-simplelogin-perl-0.18/debian/compat libcatalystx-simplelogin-perl-0.19/debian/compat --- libcatalystx-simplelogin-perl-0.18/debian/compat 2012-08-03 13:17:56.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/debian/compat 2016-07-29 18:27:40.000000000 +0000 @@ -1 +1 @@ -8 +9 diff -Nru libcatalystx-simplelogin-perl-0.18/debian/control libcatalystx-simplelogin-perl-0.19/debian/control --- libcatalystx-simplelogin-perl-0.18/debian/control 2014-05-19 09:24:40.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/debian/control 2016-07-29 18:27:40.000000000 +0000 @@ -2,8 +2,9 @@ Maintainer: Debian Perl Group Uploaders: gregor herrmann Section: perl +Testsuite: autopkgtest-pkg-perl Priority: optional -Build-Depends: debhelper (>= 8) +Build-Depends: debhelper (>= 9) Build-Depends-Indep: perl, libcatalyst-action-rest-perl, libcatalyst-actionrole-acl-perl, @@ -11,12 +12,13 @@ libcatalyst-authentication-store-dbix-class-perl, libcatalyst-model-dbic-schema-perl, libcatalyst-plugin-authentication-perl, + libcatalyst-plugin-session-perl (>= 0.35), libcatalyst-plugin-session-state-cookie-perl, - libcatalyst-plugin-session-store-file-perl, libcatalyst-perl (>= 5.90013), libcatalyst-view-tt-perl, libcatalystx-injectcomponent-perl, libcatalystx-component-traits-perl, + libclass-load-perl (>= 0.20), libhtml-formhandler-perl, libhttp-message-perl, libmoose-autobox-perl, @@ -27,10 +29,11 @@ libmoosex-types-perl, libnamespace-autoclean-perl, libsql-translator-perl, - libtest-exception-perl -Standards-Version: 3.9.5 -Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-perl/packages/libcatalystx-simplelogin-perl.git -Vcs-Git: git://anonscm.debian.org/pkg-perl/packages/libcatalystx-simplelogin-perl.git + libtest-exception-perl, + libtry-tiny-perl (>= 0.24) +Standards-Version: 3.9.8 +Vcs-Browser: https://anonscm.debian.org/cgit/pkg-perl/packages/libcatalystx-simplelogin-perl.git +Vcs-Git: https://anonscm.debian.org/git/pkg-perl/packages/libcatalystx-simplelogin-perl.git Homepage: https://metacpan.org/release/CatalystX-SimpleLogin Package: libcatalystx-simplelogin-perl @@ -41,8 +44,8 @@ libcatalyst-action-renderview-perl, libcatalyst-actionrole-acl-perl, libcatalyst-plugin-authentication-perl, + libcatalyst-plugin-session-perl (>= 0.35), libcatalyst-plugin-session-state-cookie-perl, - libcatalyst-plugin-session-store-file-perl, libcatalyst-perl (>= 5.90013), libcatalyst-view-tt-perl, libcatalystx-injectcomponent-perl, @@ -54,11 +57,12 @@ libmoosex-relatedclassroles-perl, libmoosex-types-common-perl, libmoosex-types-perl, - libnamespace-autoclean-perl + libnamespace-autoclean-perl, + libtry-tiny-perl (>= 0.24) Description: simple and reusable login controller CatalystX::SimpleLogin is an application class Moose::Role which will inject an instance of CatalystX::SimpleLogin::Controller::Login into your application. . - This provides a simple login and logout page with the adition of only one + This provides a simple login and logout page with the addition of only one line of code and one template to your application. diff -Nru libcatalystx-simplelogin-perl-0.18/debian/copyright libcatalystx-simplelogin-perl-0.19/debian/copyright --- libcatalystx-simplelogin-perl-0.18/debian/copyright 2014-03-18 09:17:29.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/debian/copyright 2016-07-29 18:27:40.000000000 +0000 @@ -1,4 +1,4 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: CatalystX-SimpleLogin Source: https://metacpan.org/release/CatalystX-SimpleLogin Upstream-Contact: Tomas Doran (t0m) "bobtfish@bobtfish.net" @@ -8,9 +8,9 @@ License: Artistic or GPL-1+ Files: inc/Module/* -Copyright: 2002-2011, Adam Kennedy - 2002-2011, Audrey Tang - 2002-2011, Brian Ingerson +Copyright: 2002-2012, Adam Kennedy + 2002-2012, Audrey Tang + 2002-2012, Brian Ingerson License: Artistic or GPL-1+ Files: debian/* diff -Nru libcatalystx-simplelogin-perl-0.18/debian/libcatalystx-simplelogin-perl.lintian-overrides libcatalystx-simplelogin-perl-0.19/debian/libcatalystx-simplelogin-perl.lintian-overrides --- libcatalystx-simplelogin-perl-0.18/debian/libcatalystx-simplelogin-perl.lintian-overrides 2013-10-21 14:11:26.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/debian/libcatalystx-simplelogin-perl.lintian-overrides 2016-07-29 18:27:40.000000000 +0000 @@ -1,2 +1,2 @@ # bad luck, this is a real long module name -libcatalystx-simplelogin-perl: manpage-has-errors-from-man usr/share/man/man3/CatalystX::SimpleLogin.3pm.gz 229: warning [p 2, 3.2i]: can't break line +libcatalystx-simplelogin-perl: manpage-has-errors-from-man usr/share/man/man3/CatalystX::SimpleLogin.3pm.gz 167: warning [p 2, 3.2i]: can't break line diff -Nru libcatalystx-simplelogin-perl-0.18/debian/patches/0001-spelling-error-in-manpage.patch libcatalystx-simplelogin-perl-0.19/debian/patches/0001-spelling-error-in-manpage.patch --- libcatalystx-simplelogin-perl-0.18/debian/patches/0001-spelling-error-in-manpage.patch 1970-01-01 00:00:00.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/debian/patches/0001-spelling-error-in-manpage.patch 2016-07-29 18:27:40.000000000 +0000 @@ -0,0 +1,16 @@ +Description: Correct typos detected by lintian +Author: Nick Morrott +Bug: https://rt.cpan.org/Ticket/Display.html?id=116452 +Last-Update: 2016-07-25 +--- +--- a/lib/CatalystX/SimpleLogin/Controller/Login.pm ++++ b/lib/CatalystX/SimpleLogin/Controller/Login.pm +@@ -292,7 +292,7 @@ + An action that is called to deal with whether the remember me flag has + been set or not. If it has been it extends the session expiry time. + +-This is only called if there was a succesful login so if you want a ++This is only called if there was a successful login so if you want a + hook into that part of the process this is a good place to hook into. + + It is also obviously a good place to hook into if you want to change diff -Nru libcatalystx-simplelogin-perl-0.18/debian/patches/series libcatalystx-simplelogin-perl-0.19/debian/patches/series --- libcatalystx-simplelogin-perl-0.18/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/debian/patches/series 2016-07-29 18:27:40.000000000 +0000 @@ -0,0 +1 @@ +0001-spelling-error-in-manpage.patch diff -Nru libcatalystx-simplelogin-perl-0.18/debian/tests/pkg-perl/syntax-skip libcatalystx-simplelogin-perl-0.19/debian/tests/pkg-perl/syntax-skip --- libcatalystx-simplelogin-perl-0.18/debian/tests/pkg-perl/syntax-skip 1970-01-01 00:00:00.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/debian/tests/pkg-perl/syntax-skip 2016-07-29 18:27:40.000000000 +0000 @@ -0,0 +1,2 @@ +# OpenID support is optional (and experimental!) +CatalystX/SimpleLogin/Form/LoginOpenID.pm diff -Nru libcatalystx-simplelogin-perl-0.18/debian/upstream/metadata libcatalystx-simplelogin-perl-0.19/debian/upstream/metadata --- libcatalystx-simplelogin-perl-0.18/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/debian/upstream/metadata 2016-07-29 18:27:40.000000000 +0000 @@ -0,0 +1,7 @@ +--- +Archive: CPAN +Bug-Database: https://rt.cpan.org/Public/Dist/Display.html?Name=CatalystX-SimpleLogin +Contact: Tomas Doran +Name: CatalystX-SimpleLogin +Repository: https://github.com/bobtfish/catalystx-simplelogin.git +Repository-Browse: https://github.com/bobtfish/catalystx-simplelogin diff -Nru libcatalystx-simplelogin-perl-0.18/inc/Module/AutoInstall.pm libcatalystx-simplelogin-perl-0.19/inc/Module/AutoInstall.pm --- libcatalystx-simplelogin-perl-0.18/inc/Module/AutoInstall.pm 2012-07-21 13:39:40.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/inc/Module/AutoInstall.pm 2016-02-22 17:17:19.000000000 +0000 @@ -8,7 +8,7 @@ use vars qw{$VERSION}; BEGIN { - $VERSION = '1.06'; + $VERSION = '1.16'; } # special map on pre-defined feature sets @@ -115,7 +115,7 @@ print "*** $class version " . $class->VERSION . "\n"; print "*** Checking for Perl dependencies...\n"; - my $cwd = Cwd::cwd(); + my $cwd = Cwd::getcwd(); $Config = []; @@ -166,7 +166,7 @@ $modules = [ %{$modules} ] if UNIVERSAL::isa( $modules, 'HASH' ); unshift @$modules, -default => &{ shift(@$modules) } - if ( ref( $modules->[0] ) eq 'CODE' ); # XXX: bugward combatability + if ( ref( $modules->[0] ) eq 'CODE' ); # XXX: bugward compatibility while ( my ( $mod, $arg ) = splice( @$modules, 0, 2 ) ) { if ( $mod =~ m/^-(\w+)$/ ) { @@ -345,22 +345,26 @@ my $i; # used below to strip leading '-' from config keys my @config = ( map { s/^-// if ++$i; $_ } @{ +shift } ); - my ( @modules, @installed ); - while ( my ( $pkg, $ver ) = splice( @_, 0, 2 ) ) { + my ( @modules, @installed, @modules_to_upgrade ); + while (my ($pkg, $ver) = splice(@_, 0, 2)) { - # grep out those already installed - if ( _version_cmp( _version_of($pkg), $ver ) >= 0 ) { - push @installed, $pkg; - } - else { - push @modules, $pkg, $ver; - } - } + # grep out those already installed + if (_version_cmp(_version_of($pkg), $ver) >= 0) { + push @installed, $pkg; + if ($UpgradeDeps) { + push @modules_to_upgrade, $pkg, $ver; + } + } + else { + push @modules, $pkg, $ver; + } + } - if ($UpgradeDeps) { - push @modules, @installed; - @installed = (); - } + if ($UpgradeDeps) { + push @modules, @modules_to_upgrade; + @installed = (); + @modules_to_upgrade = (); + } return @installed unless @modules; # nothing to do return @installed if _check_lock(); # defer to the CPAN shell @@ -533,7 +537,7 @@ while ( my ( $opt, $arg ) = splice( @config, 0, 2 ) ) { ( $args{$opt} = $arg, next ) if $opt =~ /^(?:force|notest)$/; # pseudo-option - $CPAN::Config->{$opt} = $arg; + $CPAN::Config->{$opt} = $opt eq 'urllist' ? [$arg] : $arg; } if ($args{notest} && (not CPAN::Shell->can('notest'))) { @@ -611,7 +615,7 @@ require Cwd; require File::Spec; - my $cwd = File::Spec->canonpath( Cwd::cwd() ); + my $cwd = File::Spec->canonpath( Cwd::getcwd() ); my $cpan = File::Spec->canonpath( $CPAN::Config->{cpan_home} ); return ( index( $cwd, $cpan ) > -1 ); @@ -927,4 +931,4 @@ __END__ -#line 1193 +#line 1197 diff -Nru libcatalystx-simplelogin-perl-0.18/inc/Module/Install/AutoInstall.pm libcatalystx-simplelogin-perl-0.19/inc/Module/Install/AutoInstall.pm --- libcatalystx-simplelogin-perl-0.18/inc/Module/Install/AutoInstall.pm 2012-07-21 13:39:40.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/inc/Module/Install/AutoInstall.pm 2016-02-22 17:17:19.000000000 +0000 @@ -6,7 +6,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.06'; + $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } diff -Nru libcatalystx-simplelogin-perl-0.18/inc/Module/Install/Base.pm libcatalystx-simplelogin-perl-0.19/inc/Module/Install/Base.pm --- libcatalystx-simplelogin-perl-0.18/inc/Module/Install/Base.pm 2012-07-21 13:39:38.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/inc/Module/Install/Base.pm 2016-02-22 17:17:18.000000000 +0000 @@ -4,7 +4,7 @@ use strict 'vars'; use vars qw{$VERSION}; BEGIN { - $VERSION = '1.06'; + $VERSION = '1.16'; } # Suspend handler for "redefined" warnings diff -Nru libcatalystx-simplelogin-perl-0.18/inc/Module/Install/Can.pm libcatalystx-simplelogin-perl-0.19/inc/Module/Install/Can.pm --- libcatalystx-simplelogin-perl-0.18/inc/Module/Install/Can.pm 2012-07-21 13:39:38.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/inc/Module/Install/Can.pm 2016-02-22 17:17:18.000000000 +0000 @@ -8,7 +8,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.06'; + $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } diff -Nru libcatalystx-simplelogin-perl-0.18/inc/Module/Install/Fetch.pm libcatalystx-simplelogin-perl-0.19/inc/Module/Install/Fetch.pm --- libcatalystx-simplelogin-perl-0.18/inc/Module/Install/Fetch.pm 2012-07-21 13:39:41.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/inc/Module/Install/Fetch.pm 2016-02-22 17:17:19.000000000 +0000 @@ -6,7 +6,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.06'; + $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } diff -Nru libcatalystx-simplelogin-perl-0.18/inc/Module/Install/Include.pm libcatalystx-simplelogin-perl-0.19/inc/Module/Install/Include.pm --- libcatalystx-simplelogin-perl-0.18/inc/Module/Install/Include.pm 2012-07-21 13:39:40.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/inc/Module/Install/Include.pm 2016-02-22 17:17:19.000000000 +0000 @@ -6,7 +6,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.06'; + $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } diff -Nru libcatalystx-simplelogin-perl-0.18/inc/Module/Install/Makefile.pm libcatalystx-simplelogin-perl-0.19/inc/Module/Install/Makefile.pm --- libcatalystx-simplelogin-perl-0.18/inc/Module/Install/Makefile.pm 2012-07-21 13:39:38.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/inc/Module/Install/Makefile.pm 2016-02-22 17:17:18.000000000 +0000 @@ -8,7 +8,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.06'; + $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } @@ -133,7 +133,7 @@ return $args; } -# For mm args that take multiple space-seperated args, +# For mm args that take multiple space-separated args, # append an argument to the current list. sub makemaker_append { my $self = shift; diff -Nru libcatalystx-simplelogin-perl-0.18/inc/Module/Install/Metadata.pm libcatalystx-simplelogin-perl-0.19/inc/Module/Install/Metadata.pm --- libcatalystx-simplelogin-perl-0.18/inc/Module/Install/Metadata.pm 2012-07-21 13:39:38.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/inc/Module/Install/Metadata.pm 2016-02-22 17:17:18.000000000 +0000 @@ -6,7 +6,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.06'; + $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } @@ -347,7 +347,7 @@ ^ \s* package \s* ([\w:]+) - \s* ; + [\s|;]* /ixms ) { my ($name, $module_name) = ($1, $1); @@ -705,7 +705,7 @@ my @yaml = Parse::CPAN::Meta::LoadFile('META.yml'); my $meta = $yaml[0]; - # Overwrite the non-configure dependency hashs + # Overwrite the non-configure dependency hashes delete $meta->{requires}; delete $meta->{build_requires}; delete $meta->{recommends}; diff -Nru libcatalystx-simplelogin-perl-0.18/inc/Module/Install/Win32.pm libcatalystx-simplelogin-perl-0.19/inc/Module/Install/Win32.pm --- libcatalystx-simplelogin-perl-0.18/inc/Module/Install/Win32.pm 2012-07-21 13:39:41.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/inc/Module/Install/Win32.pm 2016-02-22 17:17:19.000000000 +0000 @@ -6,7 +6,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.06'; + $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } diff -Nru libcatalystx-simplelogin-perl-0.18/inc/Module/Install/WriteAll.pm libcatalystx-simplelogin-perl-0.19/inc/Module/Install/WriteAll.pm --- libcatalystx-simplelogin-perl-0.18/inc/Module/Install/WriteAll.pm 2012-07-21 13:39:41.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/inc/Module/Install/WriteAll.pm 2016-02-22 17:17:19.000000000 +0000 @@ -6,7 +6,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.06'; + $VERSION = '1.16'; @ISA = qw{Module::Install::Base}; $ISCORE = 1; } diff -Nru libcatalystx-simplelogin-perl-0.18/inc/Module/Install.pm libcatalystx-simplelogin-perl-0.19/inc/Module/Install.pm --- libcatalystx-simplelogin-perl-0.18/inc/Module/Install.pm 2012-07-21 13:39:37.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/inc/Module/Install.pm 2016-02-22 17:17:18.000000000 +0000 @@ -17,7 +17,7 @@ # 3. The ./inc/ version of Module::Install loads # } -use 5.005; +use 5.006; use strict 'vars'; use Cwd (); use File::Find (); @@ -31,7 +31,7 @@ # This is not enforced yet, but will be some time in the next few # releases once we can make sure it won't clash with custom # Module::Install extensions. - $VERSION = '1.06'; + $VERSION = '1.16'; # Storage for the pseudo-singleton $MAIN = undef; @@ -156,10 +156,10 @@ sub autoload { my $self = shift; my $who = $self->_caller; - my $cwd = Cwd::cwd(); + my $cwd = Cwd::getcwd(); my $sym = "${who}::AUTOLOAD"; $sym->{$cwd} = sub { - my $pwd = Cwd::cwd(); + my $pwd = Cwd::getcwd(); if ( my $code = $sym->{$pwd} ) { # Delegate back to parent dirs goto &$code unless $cwd eq $pwd; @@ -239,7 +239,7 @@ # ignore the prefix on extension modules built from top level. my $base_path = Cwd::abs_path($FindBin::Bin); - unless ( Cwd::abs_path(Cwd::cwd()) eq $base_path ) { + unless ( Cwd::abs_path(Cwd::getcwd()) eq $base_path ) { delete $args{prefix}; } return $args{_self} if $args{_self}; @@ -338,7 +338,7 @@ if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) { my $content = Module::Install::_read($subpath . '.pm'); my $in_pod = 0; - foreach ( split //, $content ) { + foreach ( split /\n/, $content ) { $in_pod = 1 if /^=\w/; $in_pod = 0 if /^=cut/; next if ($in_pod || /^=cut/); # skip pod text @@ -378,6 +378,7 @@ sub _read { local *FH; open( FH, '<', $_[0] ) or die "open($_[0]): $!"; + binmode FH; my $string = do { local $/; }; close FH or die "close($_[0]): $!"; return $string; @@ -386,6 +387,7 @@ sub _read { local *FH; open( FH, "< $_[0]" ) or die "open($_[0]): $!"; + binmode FH; my $string = do { local $/; }; close FH or die "close($_[0]): $!"; return $string; @@ -416,6 +418,7 @@ sub _write { local *FH; open( FH, '>', $_[0] ) or die "open($_[0]): $!"; + binmode FH; foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!"; } @@ -425,6 +428,7 @@ sub _write { local *FH; open( FH, "> $_[0]" ) or die "open($_[0]): $!"; + binmode FH; foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!"; } @@ -434,7 +438,7 @@ # _version is for processing module versions (eg, 1.03_05) not # Perl versions (eg, 5.8.1). -sub _version ($) { +sub _version { my $s = shift || 0; my $d =()= $s =~ /(\.)/g; if ( $d >= 2 ) { @@ -450,12 +454,12 @@ return $l + 0; } -sub _cmp ($$) { +sub _cmp { _version($_[1]) <=> _version($_[2]); } # Cloned from Params::Util::_CLASS -sub _CLASS ($) { +sub _CLASS { ( defined $_[0] and diff -Nru libcatalystx-simplelogin-perl-0.18/lib/CatalystX/SimpleLogin/Controller/Login.pm libcatalystx-simplelogin-perl-0.19/lib/CatalystX/SimpleLogin/Controller/Login.pm --- libcatalystx-simplelogin-perl-0.18/lib/CatalystX/SimpleLogin/Controller/Login.pm 2012-07-15 17:22:39.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/lib/CatalystX/SimpleLogin/Controller/Login.pm 2016-01-26 12:58:15.000000000 +0000 @@ -1,7 +1,7 @@ package CatalystX::SimpleLogin::Controller::Login; use Moose; use Moose::Autobox; -use MooseX::Types::Moose qw/ HashRef ArrayRef ClassName Object Str /; +use MooseX::Types::Moose qw/ HashRef ArrayRef ClassName Object Str Int/; use MooseX::Types::Common::String qw/ NonEmptySimpleStr /; use CatalystX::SimpleLogin::Form::Login; use namespace::autoclean; @@ -21,6 +21,7 @@ RenderAsTTTemplate Logout /], + remember_me_expiry => 999999999, ); sub BUILD { @@ -52,6 +53,11 @@ default => sub { {} }, ); +has remember_me_expiry => ( + isa => Int, + is => 'ro', +); + has login_form_stash_key => ( is => 'ro', isa => Str, @@ -102,9 +108,11 @@ my $p = $ctx->req->parameters; if( $form->process(ctx => $ctx, params => $p) ) { + $ctx->change_session_id; + + $self->remember_me($ctx, $form->field( 'remember' )->value); + $self->do_post_login_redirect($ctx); - $ctx->extend_session_expires(999999999999) - if $form->field( 'remember' )->value; } $ctx->stash( @@ -116,6 +124,19 @@ ); } +sub remember_me +{ + my ($self, $ctx, $remember) = @_; + my $expire = $remember ? + $self->remember_me_expiry : $ctx->initial_session_expires - time(); + # set expiry time in storage + $ctx->change_session_expires($expire); + # refresh changed expiry time from storage + $ctx->reset_session_expires; + # update cookie TTL + $ctx->set_session_id($ctx->sessionid); +} + sub do_post_login_redirect { my ($self, $ctx) = @_; $ctx->res->redirect($self->redirect_after_login_uri($ctx)); @@ -243,8 +264,8 @@ =head2 redirect_after_login_uri -If you are using WithRedirect (i.e. by default), then this methd is overridden -to redirect the user back to the page they intially hit which required +If you are using WithRedirect (i.e. by default), then this method is overridden +to redirect the user back to the page they initially hit which required authentication. Note that even if the original URI was a post, then the redirect back will only @@ -266,6 +287,17 @@ A stub action that is anchored at the root of the site ("/") and does require registration (hence the name). +=head2 remember_me + +An action that is called to deal with whether the remember me flag has +been set or not. If it has been it extends the session expiry time. + +This is only called if there was a succesful login so if you want a +hook into that part of the process this is a good place to hook into. + +It is also obviously a good place to hook into if you want to change +the behaviour of the remember me flag. + =head1 SEE ALSO =over diff -Nru libcatalystx-simplelogin-perl-0.18/lib/CatalystX/SimpleLogin/Form/Login.pm libcatalystx-simplelogin-perl-0.19/lib/CatalystX/SimpleLogin/Form/Login.pm --- libcatalystx-simplelogin-perl-0.18/lib/CatalystX/SimpleLogin/Form/Login.pm 2011-09-05 22:06:09.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/lib/CatalystX/SimpleLogin/Form/Login.pm 2016-01-26 15:08:14.000000000 +0000 @@ -1,5 +1,6 @@ package CatalystX::SimpleLogin::Form::Login; use HTML::FormHandler::Moose; +use Try::Tiny; use namespace::autoclean; extends 'HTML::FormHandler'; @@ -44,9 +45,12 @@ sub validate { my $self = shift; - my %values = %{$self->values}; # copy the values + # as HTML::Formhandler doesn't handle exceptions thrown by user provided + # validate methods and fails to clear the 'posted' attribute we need to + # catch them unless ( - $self->ctx->authenticate( + try { + $self->ctx->authenticate( { (map { my $param_name = sprintf("authenticate_%s_field_name", $_); @@ -57,18 +61,25 @@ ($self->has_authenticate_args ? %{ $self->authenticate_args } : ()), }, ($self->has_authenticate_realm ? $self->authenticate_realm : ()), - ) + ); + } + catch { + $self->ctx->log->error("$_"); + return 0; + } ) { $self->add_auth_errors; - return; + # the return value of this method is ignored by HTML::FormHandler + # 0.40064, only errors added to the form itself or its fields control + # the forms' 'validated' attribute + return 0; } return 1; } sub add_auth_errors { my $self = shift; - $self->field( 'password' )->add_error( $self->login_error_message ) - if $self->field( 'username' )->has_value && $self->field( 'password' )->has_value; + $self->field( 'password' )->add_error( $self->login_error_message ); } __PACKAGE__->meta->make_immutable; diff -Nru libcatalystx-simplelogin-perl-0.18/lib/CatalystX/SimpleLogin/Manual.pod libcatalystx-simplelogin-perl-0.19/lib/CatalystX/SimpleLogin/Manual.pod --- libcatalystx-simplelogin-perl-0.18/lib/CatalystX/SimpleLogin/Manual.pod 2012-07-15 17:22:42.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/lib/CatalystX/SimpleLogin/Manual.pod 2016-01-26 12:58:15.000000000 +0000 @@ -169,7 +169,7 @@ ); Restart the server and try to view the hello_user page without being logged in. -You should be reredireced to the login page with the error message displayed at +You should be redireced to the login page with the error message displayed at the top. You can replace C< [% render_login_form %] > with your own html, and customize @@ -197,4 +197,15 @@ Or you can customize it using L HTML rendering features, and the 'login_form_args' config key. +To alter the amount the remember me extends the session by alter the C +configuration setting. + + __PACKAGE__->config( + 'Controller::Login' => { + remember_me_expiry => 999999999, # the default is about 32 years. + }, + # Other config.. + ); + + =cut diff -Nru libcatalystx-simplelogin-perl-0.18/lib/CatalystX/SimpleLogin/TraitFor/Controller/Login/Logout.pm libcatalystx-simplelogin-perl-0.19/lib/CatalystX/SimpleLogin/TraitFor/Controller/Login/Logout.pm --- libcatalystx-simplelogin-perl-0.18/lib/CatalystX/SimpleLogin/TraitFor/Controller/Login/Logout.pm 2012-05-05 11:42:48.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/lib/CatalystX/SimpleLogin/TraitFor/Controller/Login/Logout.pm 2016-01-26 12:58:15.000000000 +0000 @@ -6,6 +6,7 @@ sub logout : Chained('/') PathPart('logout') Args(0) { my ($self, $c) = @_; $c->logout; + $c->change_session_id; $self->do_clear_session_on_logout($c) if $self->clear_session_on_logout; $c->res->redirect($self->redirect_after_logout_uri($c)); } diff -Nru libcatalystx-simplelogin-perl-0.18/lib/CatalystX/SimpleLogin.pm libcatalystx-simplelogin-perl-0.19/lib/CatalystX/SimpleLogin.pm --- libcatalystx-simplelogin-perl-0.18/lib/CatalystX/SimpleLogin.pm 2012-07-21 13:39:22.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/lib/CatalystX/SimpleLogin.pm 2016-02-22 17:17:05.000000000 +0000 @@ -3,7 +3,7 @@ use CatalystX::InjectComponent; use namespace::autoclean; -our $VERSION = '0.18'; +our $VERSION = '0.19'; after 'setup_components' => sub { my $class = shift; @@ -54,7 +54,7 @@ CatalystX::SimpleLogin is an application class L which will inject a L which is an instance of L into your -application. This provides a simple login and logout page with the adition +application. This provides a simple login and logout page with the addition of only one line of code and one template to your application. =head1 REQUIREMENTS @@ -225,7 +225,7 @@ Copyright 2009 Tomas Doran. Some rights reserved. -This sofware is free software, and is licensed under the same terms as perl itself. +This software is free software, and is licensed under the same terms as perl itself. =cut diff -Nru libcatalystx-simplelogin-perl-0.18/Makefile.PL libcatalystx-simplelogin-perl-0.19/Makefile.PL --- libcatalystx-simplelogin-perl-0.18/Makefile.PL 2012-07-21 13:38:14.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/Makefile.PL 2016-01-26 13:29:52.000000000 +0000 @@ -23,14 +23,15 @@ requires 'Moose::Autobox'; requires 'HTML::FormHandler' => '0.28001'; requires 'namespace::autoclean'; -requires 'Catalyst::Plugin::Session' => '0.27'; # Required as we use the 'Plugin::Session' config key in ::Manual +requires 'Catalyst::Plugin::Session' => '0.35'; # Required as we use the 'Plugin::Session' config key in ::Manual +requires 'Try::Tiny' => '0.24'; -test_requires 'Test::More' => '0.94'; +test_requires 'Test::More' => '0.94'; +test_requires 'Class::Load' => '0.20'; test_requires 'Test::Exception'; test_requires 'File::Temp'; test_requires 'Catalyst::Action::RenderView'; test_requires 'Catalyst::Plugin::Session::State::Cookie'; -test_requires 'Catalyst::Plugin::Session::Store::File'; test_requires 'HTTP::Request::Common'; test_requires 'Catalyst::ActionRole::ACL'; test_requires 'CatalystX::InjectComponent'; diff -Nru libcatalystx-simplelogin-perl-0.18/META.yml libcatalystx-simplelogin-perl-0.19/META.yml --- libcatalystx-simplelogin-perl-0.18/META.yml 2012-07-21 13:39:41.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/META.yml 2016-02-22 17:17:19.000000000 +0000 @@ -1,24 +1,24 @@ --- abstract: 'Provide a simple Login controller which can be reused' author: - - '=over' + - =over build_requires: Catalyst::Action::RenderView: 0 Catalyst::ActionRole::ACL: 0 Catalyst::Plugin::Session::State::Cookie: 0 - Catalyst::Plugin::Session::Store::File: 0 CatalystX::InjectComponent: 0 + Class::Load: '0.20' ExtUtils::MakeMaker: 6.36 File::Temp: 0 HTTP::Request::Common: 0 SQL::Translator: 0 Test::Exception: 0 - Test::More: 0.94 + Test::More: '0.94' configure_requires: ExtUtils::MakeMaker: 6.36 distribution_type: module dynamic_config: 1 -generated_by: 'Module::Install version 1.06' +generated_by: 'Module::Install version 1.16' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -28,43 +28,24 @@ directory: - inc - t -provides: - Catalyst::ActionRole::NeedsLogin: - file: lib/Catalyst/ActionRole/NeedsLogin.pm - CatalystX::SimpleLogin: - file: lib/CatalystX/SimpleLogin.pm - version: 0.18 - CatalystX::SimpleLogin::Controller::Login: - file: lib/CatalystX/SimpleLogin/Controller/Login.pm - CatalystX::SimpleLogin::Form::Login: - file: lib/CatalystX/SimpleLogin/Form/Login.pm - CatalystX::SimpleLogin::Form::LoginOpenID: - file: lib/CatalystX/SimpleLogin/Form/LoginOpenID.pm - CatalystX::SimpleLogin::TraitFor::Controller::Login::Logout: - file: lib/CatalystX/SimpleLogin/TraitFor/Controller/Login/Logout.pm - CatalystX::SimpleLogin::TraitFor::Controller::Login::OpenID: - file: lib/CatalystX/SimpleLogin/TraitFor/Controller/Login/OpenID.pm - CatalystX::SimpleLogin::TraitFor::Controller::Login::RenderAsTTTemplate: - file: lib/CatalystX/SimpleLogin/TraitFor/Controller/Login/RenderAsTTTemplate.pm - CatalystX::SimpleLogin::TraitFor::Controller::Login::WithRedirect: - file: lib/CatalystX/SimpleLogin/TraitFor/Controller/Login/WithRedirect.pm requires: - Catalyst::Action::REST: 0.74 + Catalyst::Action::REST: '0.74' Catalyst::Plugin::Authentication: 0 - Catalyst::Plugin::Session: 0.27 - Catalyst::Runtime: 5.80013 + Catalyst::Plugin::Session: '0.35' + Catalyst::Runtime: '5.80013' Catalyst::View::TT: 0 - CatalystX::Component::Traits: 0.13 + CatalystX::Component::Traits: '0.13' CatalystX::InjectComponent: 0 - HTML::FormHandler: 0.28001 + HTML::FormHandler: '0.28001' Moose: 0 Moose::Autobox: 0 - MooseX::MethodAttributes: 0.18 - MooseX::RelatedClassRoles: 0.004 + MooseX::MethodAttributes: '0.18' + MooseX::RelatedClassRoles: '0.004' MooseX::Types: 0 MooseX::Types::Common: 0 + Try::Tiny: '0.24' namespace::autoclean: 0 resources: license: http://dev.perl.org/licenses/ repository: git://github.com/bobtfish/catalystx-simplelogin.git -version: 0.18 +version: '0.19' diff -Nru libcatalystx-simplelogin-perl-0.18/README libcatalystx-simplelogin-perl-0.19/README --- libcatalystx-simplelogin-perl-0.18/README 2012-07-21 13:39:40.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/README 2016-02-22 17:17:19.000000000 +0000 @@ -35,7 +35,7 @@ CatalystX::SimpleLogin is an application class Moose::Role which will inject a Catalyst::Controller which is an instance of CatalystX::SimpleLogin::Controller::Login into your application. This - provides a simple login and logout page with the adition of only one + provides a simple login and logout page with the addition of only one line of code and one template to your application. REQUIREMENTS @@ -143,6 +143,6 @@ LICENSE Copyright 2009 Tomas Doran. Some rights reserved. - This sofware is free software, and is licensed under the same terms as + This software is free software, and is licensed under the same terms as perl itself. diff -Nru libcatalystx-simplelogin-perl-0.18/t/01-live-test.t libcatalystx-simplelogin-perl-0.19/t/01-live-test.t --- libcatalystx-simplelogin-perl-0.18/t/01-live-test.t 2010-01-27 21:53:45.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/t/01-live-test.t 2016-01-26 12:58:15.000000000 +0000 @@ -24,20 +24,44 @@ like($c->res->body, qr/submit/, 'submit button on form'); ($res, $c) = ctx_request(POST 'http://localhost/login', [username => 'bob', password => 's00p3r']); -ok( ($c->session_expires-time()-7200) <= 0, 'Session length low when no "remember"'); -($res, $c) = ctx_request(POST 'http://localhost/login', [username => 'bob', password => 's00p3r', remember => 1]); -TODO: { - local $TODO = "Session expiry doesn't work"; -ok( ($c->session_expires-time()-7200) >= 0, 'Long session set when "remember"'); -} is($res->code, 302, 'get 302 redirect'); my $cookie = $res->header('Set-Cookie'); ok($cookie, 'Have a cookie'); is($res->header('Location'), 'http://localhost/', 'Redirect to /'); ok($c->user, 'Have a user in $c'); - ($res, $c) = ctx_request(GET 'http://localhost/', Cookie => $cookie); like($c->res->body, qr/Logged in/, 'Am logged in'); +ok( $c->session_is_valid, 'Session is valid'); +ok( ($c->session_expires && $c->session_expires-time()-7200) <= 0, 'Session length low when no "remember"'); + +($res, $c) = ctx_request(GET 'http://localhost/logout', Cookie => $cookie); +ok(!$c->user_exists, 'No user in $c after logout'); + +($res, $c) = ctx_request(POST 'http://localhost/login', [username => 'bob', password => 's00p3r', remember => 1], Cookie => $cookie); +my ($session_id) = $cookie=~/testapp_session=(.*?);/; +$cookie = $res->header('Set-Cookie'); +my ($new_session_id) = $cookie=~/testapp_session=(.*?);/; +isnt $session_id, $new_session_id, 'Session id should have changed.'; +($res, $c) = ctx_request(GET 'http://localhost/', Cookie => $cookie); +ok( (($c->session_expires-time()-7200) > 0) && + (($c->session_expires-time()-1000000000) < 0) , 'Long session set when "remember"'); + +$cookie = $res->header('Set-Cookie'); +ok($cookie, 'Have a cookie'); +ok($c->user_exists, 'have the user back after re-login with "remember"'); + +($res, $c) = ctx_request(GET 'http://localhost/logout', Cookie => $cookie); +$cookie = $res->header('Set-Cookie'); +my ($new_new_session_id) = $cookie=~/testapp_session=(.*?);/; +isnt $new_new_session_id, $new_session_id, 'Check session id changed when we logged out'; +$cookie = $res->header('Set-Cookie'); +ok(!$c->user_exists, 'No user in $c after logout from long session'); +$cookie = $res->header('Set-Cookie'); + +($res, $c) = ctx_request(POST 'http://localhost/login', [username => 'bob', password => 's00p3r'], Cookie => $cookie); +$cookie = $res->header('Set-Cookie'); +($res, $c) = ctx_request(GET 'http://localhost/', Cookie => $cookie); +ok( ($c->session_expires && $c->session_expires-time()-7200) <= 0, 'Session length is low again when no "remember"'); $res = request(GET 'http://localhost/needsauth', Cookie => $cookie); is($res->code, 200, '/needsauth 200OK now'); diff -Nru libcatalystx-simplelogin-perl-0.18/t/02-redirect-test.t libcatalystx-simplelogin-perl-0.19/t/02-redirect-test.t --- libcatalystx-simplelogin-perl-0.18/t/02-redirect-test.t 2009-12-19 15:04:36.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/t/02-redirect-test.t 2016-01-26 12:58:15.000000000 +0000 @@ -28,6 +28,7 @@ my $cookie = $res->header('Set-Cookie'); ok($cookie, 'Have a cookie'); ($res, $c) = ctx_request(POST '/login', [username => 'bob', password => 's00p3r'], Cookie => $cookie); + $cookie = $res->header('Set-Cookie'); ok(!exists($c->session->{redirect_to_after_login}), '$c->session->{redirect_to_after_login} cleared'); ok($c->user, 'Have a user in $c'); is($res->code, 302, 'get 302 redirect to needslogin'); diff -Nru libcatalystx-simplelogin-perl-0.18/t/06-rendertt.t libcatalystx-simplelogin-perl-0.19/t/06-rendertt.t --- libcatalystx-simplelogin-perl-0.18/t/06-rendertt.t 2009-11-07 21:19:10.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/t/06-rendertt.t 2016-01-26 12:58:15.000000000 +0000 @@ -21,16 +21,17 @@ ($res, $c) = ctx_request(POST 'http://localhost/login', [username => 'bob', password => 's00p3r']); +my $cookie = $res->header('Set-Cookie'); +($res, $c) = ctx_request(GET 'http://localhost/', Cookie => $cookie); ok( ($c->session_expires-time()-7200) <= 0, 'Session length low when no "remember"'); ($res, $c) = ctx_request(POST 'http://localhost/login', [username => 'bob', password => 's00p3r', remember => 1]); -TODO: { - local $TODO = "Session expiry doesn't work"; -ok( ($c->session_expires-time()-7200) >= 0, 'Long session set when "remember"'); -} +$cookie = $res->header('Set-Cookie'); is($res->code, 302, 'get 302 redirect'); -my $cookie = $res->header('Set-Cookie'); -ok($cookie, 'Have a cookie'); is($res->header('Location'), 'http://localhost/', 'Redirect to /'); +($res, $c) = ctx_request(GET 'http://localhost/', Cookie => $cookie); +ok( ($c->session_expires-time()-7200) >= 0, 'Long session set when "remember"'); +$cookie = $res->header('Set-Cookie'); +ok($cookie, 'Have a cookie'); ok($c->user, 'Have a user in $c'); ($res, $c) = ctx_request(GET 'http://localhost/', Cookie => $cookie); diff -Nru libcatalystx-simplelogin-perl-0.18/t/08-dbic-mappedfields.t libcatalystx-simplelogin-perl-0.19/t/08-dbic-mappedfields.t --- libcatalystx-simplelogin-perl-0.18/t/08-dbic-mappedfields.t 2010-06-15 21:20:23.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/t/08-dbic-mappedfields.t 2016-01-26 12:58:15.000000000 +0000 @@ -2,7 +2,7 @@ use warnings; use Test::More; use Test::Exception; -use Class::MOP; +use Class::Load; use HTTP::Request::Common; use FindBin qw/$Bin/; use lib "$Bin/lib"; @@ -15,7 +15,7 @@ /; plan skip_all => "One of the required classes for this test $@ (" . join(',', @needed) . ") not found." unless eval { - Class::MOP::load_class($_) for @needed; 1; + Class::Load::load_class($_) for @needed; 1; }; plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for('admin') unless DBIx::Class::Optional::Dependencies->req_ok_for('admin'); diff -Nru libcatalystx-simplelogin-perl-0.18/t/09-clearsession.t libcatalystx-simplelogin-perl-0.19/t/09-clearsession.t --- libcatalystx-simplelogin-perl-0.18/t/09-clearsession.t 2010-06-02 16:04:18.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/t/09-clearsession.t 2016-01-26 12:58:15.000000000 +0000 @@ -42,6 +42,7 @@ ($res, $c) = ctx_request(POST 'login', [ username => 'william', password => 's3cr3t' ], Cookie => $cookie ); is($res->code, 302, 'Logged in so therefore got 302 redirect'); +$cookie = $res->header('Set-Cookie'); # Is there still something in the session?.. ($res, $c) = ctx_request(GET '/viewsess', Cookie => $cookie); like($c->res->body, qr/session_var1_set=someval1/, ''); diff -Nru libcatalystx-simplelogin-perl-0.18/t/lib/TestAppBase.pm libcatalystx-simplelogin-perl-0.19/t/lib/TestAppBase.pm --- libcatalystx-simplelogin-perl-0.18/t/lib/TestAppBase.pm 2012-07-13 14:39:27.000000000 +0000 +++ libcatalystx-simplelogin-perl-0.19/t/lib/TestAppBase.pm 2016-01-26 12:58:15.000000000 +0000 @@ -8,7 +8,7 @@ +CatalystX::SimpleLogin Authentication Session - Session::Store::File + Session::Store::Dummy Session::State::Cookie /; extends 'Catalyst';