Catalyst-Plugin-Session-Store-DBIC-0.15000755001750001750 015235436304 17621 5ustar00andrewandrew000000000000README100644001750001750 61015235436304 20537 0ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15This archive contains the distribution Catalyst-Plugin-Session-Store-DBIC, version 0.15: Store your sessions via DBIx::Class This software is copyright (c) 2026 by Andrew Rodland. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. This README file was generated by Dist::Zilla::Plugin::Readme v6.037. Changes100644001750001750 550015235436304 21175 0ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15Revision history for Catalyst-Plugin-Session-Store-DBIC 0.15 Fri Aug 07 16:15:00 EDT 2026 - Release 0.14_9901 without changes. 0.14_9901 Sun Jun 14 20:27:47 EDT 2026 - Fix $c->change_session_id causing "row not found" error (RT#112679). Thanks to Cees Hek for the original report, violapiratejunky for the patch, and MYSOCIETY for additional information in RT#178695. - Fix typo in source. RT#87248 0.14 Sat Jul 27 12:29:00 PST 2013 - Fix repository metadaa. RT#87249 0.13 Fri Jun 14 17:30:00 BST 2013 - Don't use %ENV for passing data structures to tests. This fixes the tests on Perl 5.18, which stringifies %ENV values immediately. RT#86148 0.12 Thu Aug 4 23:56:00 BST 2011 - Changed a test case to be less picky about the actual text captured from warnings. This was done to support some changes introduced by the Catalyst -> PSGI port. 0.11 Fri Oct 16 15:04:07 CEST 2009 - Convert to new session config key. 0.10 Tue Jul 7 13:00:27 CEST 2009 - Depend on a recent Store::Delegate for the NEXT -> MRO::Compat switch. 0.09 Wed Mar 31 16:35:52 CEST 2009 - Port from NEXT to MRO::Compat (Florian Ragwitz). - Remove tests relying on the deprecated DBIx::Class::DB (Florian Ragwitz). 0.08 Wed Nov 26 10:02:52 EST 2008 - Workaround possible errors with Storable::thaw and empty strings (thanks to kevin montuori for suggesting a fix) 0.07 Wed Sep 24 17:08:34 EDT 2008 - Code was silently truncating storage to MySQL, rendering the session unreadable. Patched to check DBIx::Class size from column_info (if available) - Wrap find_or_create calls in a transaction to (hopefully) avoid issues with duplicate flash rows 0.06 Sat Sep 16 15:42:50 EDT 2006 - Convert to Catalyst::Plugin::Session::Store::Delegate (with help from nothingmuch) 0.05 Mon Jul 31 16:58:32 EDT 2006 - Bump Catalyst::Plugin::Session dependency (tests use session_is_valid) - Fix a possible bug with passing an empty string to Storable::thaw 0.04 Sat Jul 29 23:02:27 EDT 2006 - Catalyst::Plugin::Session 0.06 saves the session expiration before the sesssion, so make sure the session row is created then - Minor cleanup to get_session_data and store_session_data methods - Use delete instead of delete_all to avoid object inflation penalty in delete_session_data and delete_expired_sessions - Use 'select' to fetch only the desired field from the database 0.03 Mon Mar 6 21:17:38 EST 2006 - Check the configuration earlier for a dbic_class value 0.02 Sat Mar 4 15:55:30 EST 2006 - Minor documentation update 0.01 Sat Mar 4 13:02:28 EST 2006 - Initial revision LICENSE100644001750001750 4630715235436304 20741 0ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15This software is copyright (c) 2026 by Andrew Rodland. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2026 by Andrew Rodland. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Moe Ghoul, President of Vice That's all there is to it! --- The Perl Artistic License 1.0 --- This software is Copyright (c) 2026 by Andrew Rodland. This is free software, licensed under: The Perl Artistic License 1.0 The "Artistic License" Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder as specified below. "Copyright Holder" is whoever is named in the copyright or copyrights for the package. "You" is you, if you're thinking about copying or distributing this Package. "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as uunet.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) give non-standard executables non-standard names, and clearly document the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. You may embed this Package's interpreter within an executable of yours (by linking); this shall be construed as a mere form of aggregation, provided that the complete Standard Version of the interpreter is so embedded. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whoever generated them, and may be sold commercially, and may be aggregated with this Package. If such scripts or library files are aggregated with this Package via the so-called "undump" or "unexec" methods of producing a binary executable image, then distribution of such an image shall neither be construed as a distribution of this Package nor shall it fall under the restrictions of Paragraphs 3 and 4, provided that you do not represent such an executable image as a Standard Version of this Package. 7. C subroutines (or comparably compiled subroutines in other languages) supplied by you and linked into this Package in order to emulate subroutines and variables of the language defined by this Package shall not be considered part of this Package, but are the equivalent of input as in Paragraph 6, provided these subroutines do not change the language in any way that would cause it to fail the regression tests for the language. 8. Aggregation of this Package with a commercial distribution is always permitted provided that the use of this Package is embedded; that is, when no overt attempt is made to make this Package's interfaces visible to the end user of the commercial distribution. Such use shall not be construed as a distribution of this Package. 9. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End dist.ini100644001750001750 251515235436304 21351 0ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15name = Catalyst-Plugin-Session-Store-DBIC author = Andrew Rodland license = Perl_5 copyright_holder = Andrew Rodland abstract = Store your sessions via DBIx::Class [@Basic] [Prereqs] Carp = 0 Catalyst = 5.65 Catalyst::Exception = 0 Catalyst::Plugin::Session::Store::Delegate = 0.05 Class::Accessor::Fast = 0 DBIx::Class = 0.07000 MIME::Base64 = 0 MRO::Compat = 0 Scalar::Util = 0 Storable = 0 [Prereqs/TestRequires] Test::More = 0 Test::Warn = 0.20 FindBin = 0 [Prereqs/TestSuggests] Test::WWW::Mechanize::Catalyst = 0 Catalyst::Plugin::Session::State::Cookie = 0 Catalyst::Model::DBIC::Schema = 0 [Prereqs/DevelopRecommends] Test::Pod = 0 Test::Pod::Coverage = 0 [OurPkgVersion] [MetaJSON] [MetaNoIndex] directory = t [MetaResources] bugtracker.web = https://rt.cpan.org/Public/Dist/Display.html?Name=Catalyst-Plugin-Session-Store-DBIC repository.web = https://github.com/perl-catalyst/Catalyst-Plugin-Session-Store-DBIC repository.url = https://github.com/perl-catalyst/Catalyst-Plugin-Session-Store-DBIC.git repository.type = git license = https://dev.perl.org/licenses/ [NextRelease] format = %v %{EEE MMM dd HH:mm:ss vvv YYYY}d [CheckChangesHasContent] [@Git] allow_dirty = dist.ini allow_dirty = README allow_dirty = Changes changelog = Changes commit_msg = Release v%v%n%n%c push_to = origin [Git::NextVersion] META.yml100644001750001750 217015235436304 21153 0ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15--- abstract: 'Store your sessions via DBIx::Class' author: - 'Andrew Rodland ' build_requires: FindBin: '0' Test::More: '0' Test::Warn: '0.20' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.037, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Catalyst-Plugin-Session-Store-DBIC no_index: directory: - t requires: Carp: '0' Catalyst: '5.65' Catalyst::Exception: '0' Catalyst::Plugin::Session::Store::Delegate: '0.05' Class::Accessor::Fast: '0' DBIx::Class: '0.07000' MIME::Base64: '0' MRO::Compat: '0' Scalar::Util: '0' Storable: '0' resources: bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Catalyst-Plugin-Session-Store-DBIC license: https://dev.perl.org/licenses/ repository: https://github.com/perl-catalyst/Catalyst-Plugin-Session-Store-DBIC.git version: '0.15' x_generated_by_perl: v5.42.2 x_serialization_backend: 'YAML::Tiny version 1.76' x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' MANIFEST100644001750001750 77415235436304 21023 0ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.037 Changes LICENSE MANIFEST META.json META.yml Makefile.PL README dist.ini lib/Catalyst/Plugin/Session/Store/DBIC.pm lib/Catalyst/Plugin/Session/Store/DBIC/Delegate.pm t/01use.t t/02pod.t t/03podcoverage.t t/05dbic-schema.t t/lib/SetupDB.pm t/lib/TestApp.pm t/lib/TestApp/Controller/Flash.pm t/lib/TestApp/Controller/Session.pm t/lib/TestApp/Model/DBICSchema.pm t/lib/TestApp/Schema.pm t/lib/TestApp/Schema/Session.pm t/session.db t000755001750001750 015235436304 20005 5ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.1501use.t100644001750001750 11615235436304 21245 0ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15/tuse Test::More tests => 1; use_ok('Catalyst::Plugin::Session::Store::DBIC'); 02pod.t100644001750001750 27615235436304 21243 0ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15/tuse Test::More; eval "use Test::Pod 1.14"; plan skip_all => 'Test::Pod 1.14 required' if $@; plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD}; all_pod_files_ok(); META.json100644001750001750 432715235436304 21331 0ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15{ "abstract" : "Store your sessions via DBIx::Class", "author" : [ "Andrew Rodland " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.037, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Catalyst-Plugin-Session-Store-DBIC", "no_index" : { "directory" : [ "t" ] }, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "develop" : { "recommends" : { "Test::Pod" : "0", "Test::Pod::Coverage" : "0" } }, "runtime" : { "requires" : { "Carp" : "0", "Catalyst" : "5.65", "Catalyst::Exception" : "0", "Catalyst::Plugin::Session::Store::Delegate" : "0.05", "Class::Accessor::Fast" : "0", "DBIx::Class" : "0.07000", "MIME::Base64" : "0", "MRO::Compat" : "0", "Scalar::Util" : "0", "Storable" : "0" } }, "test" : { "requires" : { "FindBin" : "0", "Test::More" : "0", "Test::Warn" : "0.20" }, "suggests" : { "Catalyst::Model::DBIC::Schema" : "0", "Catalyst::Plugin::Session::State::Cookie" : "0", "Test::WWW::Mechanize::Catalyst" : "0" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=Catalyst-Plugin-Session-Store-DBIC" }, "license" : [ "https://dev.perl.org/licenses/" ], "repository" : { "type" : "git", "url" : "https://github.com/perl-catalyst/Catalyst-Plugin-Session-Store-DBIC.git", "web" : "https://github.com/perl-catalyst/Catalyst-Plugin-Session-Store-DBIC" } }, "version" : "0.15", "x_generated_by_perl" : "v5.42.2", "x_serialization_backend" : "Cpanel::JSON::XS version 4.42", "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later" } Makefile.PL100644001750001750 320315235436304 21652 0ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.037 use strict; use warnings; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "Store your sessions via DBIx::Class", "AUTHOR" => "Andrew Rodland ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "Catalyst-Plugin-Session-Store-DBIC", "LICENSE" => "perl", "NAME" => "Catalyst::Plugin::Session::Store::DBIC", "PREREQ_PM" => { "Carp" => 0, "Catalyst" => "5.65", "Catalyst::Exception" => 0, "Catalyst::Plugin::Session::Store::Delegate" => "0.05", "Class::Accessor::Fast" => 0, "DBIx::Class" => "0.07000", "MIME::Base64" => 0, "MRO::Compat" => 0, "Scalar::Util" => 0, "Storable" => 0 }, "TEST_REQUIRES" => { "FindBin" => 0, "Test::More" => 0, "Test::Warn" => "0.20" }, "VERSION" => "0.15", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Carp" => 0, "Catalyst" => "5.65", "Catalyst::Exception" => 0, "Catalyst::Plugin::Session::Store::Delegate" => "0.05", "Class::Accessor::Fast" => 0, "DBIx::Class" => "0.07000", "FindBin" => 0, "MIME::Base64" => 0, "MRO::Compat" => 0, "Scalar::Util" => 0, "Storable" => 0, "Test::More" => 0, "Test::Warn" => "0.20" ); unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) { delete $WriteMakefileArgs{TEST_REQUIRES}; delete $WriteMakefileArgs{BUILD_REQUIRES}; $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; } delete $WriteMakefileArgs{CONFIGURE_REQUIRES} unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; WriteMakefile(%WriteMakefileArgs); session.db100644001750001750 3000015235436304 22150 0ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15/tSQLite format 3@ .�ù ø66Ç��otablesessionssessionsCREATE TABLE sessions ( id CHAR(72) PRIMARY KEY, data TEXT, expires INTEGER )/Cindexsqlite_autoindex_sessions_1sessions  lib000755001750001750 015235436304 20553 5ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15/tSetupDB.pm100644001750001750 60715235436304 22542 0ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15/t/libpackage SetupDB; use strict; use warnings; # Create the database my $db_file = $TestApp::DB_FILE; unlink $db_file if -e $db_file; my $dbh = DBI->connect("dbi:SQLite:$db_file") or die $DBI::errstr; my $sql = q{ CREATE TABLE sessions ( id CHAR(72) PRIMARY KEY, data TEXT, expires INTEGER ); }; $dbh->do($_) for split /;/, $sql; $dbh->disconnect; 1; TestApp.pm100644001750001750 22215235436304 22605 0ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15/t/libpackage TestApp; use strict; use warnings; use Catalyst; __PACKAGE__->config($TestApp::CONFIG); __PACKAGE__->setup(@{ $TestApp::PLUGINS }); 1; 05dbic-schema.t100644001750001750 606715235436304 22647 0ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15/t#!perl use strict; use warnings; use FindBin; use Test::More; use Test::Warn; use lib "$FindBin::Bin/lib"; BEGIN { eval { require DBD::SQLite } or plan skip_all => "DBD::SQLite is required for this test"; eval { require Catalyst::Plugin::Session::State::Cookie } or plan skip_all => "Catalyst::Plugin::Session::State::Cookie is required for this test"; eval { require Test::WWW::Mechanize::Catalyst } or plan skip_all => "Test::WWW::Mechanize::Catalyst is required for this test"; eval { require Catalyst::Model::DBIC::Schema } or plan skip_all => "Catalyst::Model::DBIC::Schema is required for this test"; plan tests => 21; $TestApp::DB_FILE = "$FindBin::Bin/session.db"; $TestApp::CONFIG = { name => 'TestApp', session => { dbic_class => 'DBICSchema::Session', data_field => 'data', }, }; $TestApp::PLUGINS = [qw/ Session Session::State::Cookie Session::Store::DBIC /]; } use SetupDB; use Test::WWW::Mechanize::Catalyst 'TestApp'; my $mech = Test::WWW::Mechanize::Catalyst->new; my $key = 'schema'; my $value = scalar localtime; # Setup session $mech->get_ok("http://localhost/session/setup?key=$key&value=$value", 'request to set session value'); $mech->content_is('ok', 'set session value'); # Setup flash $mech->get_ok("http://localhost/flash/setup?key=$key&value=$value", 'request to set flash value'); $mech->content_is('ok', 'set session value'); # Check flash $mech->get_ok("http://localhost/flash/output?key=$key", 'request to get flash value'); $mech->content_is($value, 'got session value back'); # Check session $mech->get_ok("http://localhost/session/output?key=$key", 'request to get session value'); $mech->content_is($value, 'got session value back'); # Check change_session_id $mech->get_ok("http://localhost/session/sessionid", 'request current session ID'); my $sid = $mech->content; $mech->get_ok("http://localhost/session/change", 'request to change session ID'); $mech->content_is('ok', 'successful'); $mech->get_ok("http://localhost/session/sessionid", 'request current session ID'); ok($mech->content ne $sid, 'session ID changed'); $mech->get_ok("http://localhost/session/output?key=$key", 'request to get session value'); $mech->content_is($value, 'got session value back'); # Exceed our session storage capactity $value = "blah" x 200; warnings_exist { $mech->get_ok("http://localhost/session/setup?key=$key&value=$value", 'exceeding storage capacity'); } qr/This session requires \d+ bytes of storage, but your database column 'data' can only store 200 bytes. Storing this session may not be reliable; increase the size of your data field/, 'warning thrown as expected'; # Delete session $mech->get_ok('http://localhost/session/delete', 'request to delete session'); $mech->content_is('ok', 'deleted session'); # Delete expired sessions $mech->get_ok('http://localhost/session/delete_expired', 'request to delete expired sessions'); $mech->content_is('ok', 'deleted expired sessions'); # Clean up unlink $TestApp::DB_FILE; 03podcoverage.t100644001750001750 32515235436304 22753 0ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15/tuse Test::More; eval "use Test::Pod::Coverage 1.04"; plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@; plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD}; all_pod_coverage_ok(); TestApp000755001750001750 015235436304 22133 5ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15/t/libSchema.pm100644001750001750 20115235436304 24002 0ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15/t/lib/TestApppackage TestApp::Schema; use strict; use warnings; use base qw/DBIx::Class::Schema/; __PACKAGE__->load_classes('Session'); 1; Schema000755001750001750 015235436304 23333 5ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15/t/lib/TestAppSession.pm100644001750001750 47315235436304 25440 0ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15/t/lib/TestApp/Schemapackage TestApp::Schema::Session; use strict; use warnings; use base qw/DBIx::Class/; __PACKAGE__->load_components(qw/Core/); __PACKAGE__->table('sessions'); __PACKAGE__->add_columns( id => { }, data => { size => 200, }, expires => { }, ); __PACKAGE__->set_primary_key('id'); 1; Model000755001750001750 015235436304 23173 5ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15/t/lib/TestAppDBICSchema.pm100644001750001750 60215235436304 25471 0ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15/t/lib/TestApp/Modelpackage TestApp::Model::DBICSchema; eval { require Catalyst::Model::DBIC::Schema }; return 1 if $@; @ISA = qw/Catalyst::Model::DBIC::Schema/; use strict; use warnings; our $db_file = $TestApp::DB_FILE; __PACKAGE__->config( schema_class => 'TestApp::Schema', connect_info => [ "dbi:SQLite:$db_file", '', '', { AutoCommit => 1 }, ], ); 1; Controller000755001750001750 015235436304 24256 5ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15/t/lib/TestAppFlash.pm100644001750001750 67015235436304 25774 0ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15/t/lib/TestApp/Controllerpackage TestApp::Controller::Flash; use strict; use warnings; use base qw/Catalyst::Controller/; sub setup : Local { my ($self, $c) = @_; my $key = $c->req->param('key') || 'key'; my $value = $c->req->param('value') || 1; $c->flash->{$key} = $value; $c->res->body('ok'); } sub output : Local { my ($self, $c) = @_; my $key = $c->req->param('key') || 'key'; $c->res->body($c->flash->{$key}); } 1; Session.pm100644001750001750 172715235436304 26406 0ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15/t/lib/TestApp/Controllerpackage TestApp::Controller::Session; use strict; use warnings; use base qw/Catalyst::Controller/; sub setup : Local { my ($self, $c) = @_; my $key = $c->req->param('key') || 'key'; my $value = $c->req->param('value') || 1; $c->session->{$key} = $value; $c->res->body('ok'); } sub output : Local { my ($self, $c) = @_; my $key = $c->req->param('key') || 'key'; $c->res->body($c->session->{$key}); } sub delete : Local { my ($self, $c) = @_; $c->delete_session; $c->res->body($c->session_is_valid ? 'not ok' : 'ok'); } sub delete_expired : Local { my ($self, $c) = @_; $c->delete_expired_sessions; $c->res->body('ok'); } sub change : Local { my ($self, $c) = @_; my $oldsid = $c->sessionid; $c->change_session_id; my $newsid = $c->sessionid; $c->res->body(($oldsid ne $newsid) ? 'ok' : 'not ok'); } sub sessionid : Local { my ($self, $c) = @_; $c->res->body($c->sessionid); } 1; Store000755001750001750 015235436304 26051 5ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15/lib/Catalyst/Plugin/SessionDBIC.pm100644001750001750 2260215235436304 27272 0ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15/lib/Catalyst/Plugin/Session/Storepackage Catalyst::Plugin::Session::Store::DBIC; use strict; use warnings; use base qw/Catalyst::Plugin::Session::Store::Delegate/; use Catalyst::Exception; use Catalyst::Plugin::Session::Store::DBIC::Delegate; use MIME::Base64 (); use MRO::Compat; use Storable (); our $VERSION = '0.15'; # VERSION =head1 NAME Catalyst::Plugin::Session::Store::DBIC - Store your sessions via DBIx::Class =head1 SYNOPSIS # Create a table in your database for sessions CREATE TABLE sessions ( id CHAR(72) PRIMARY KEY, session_data TEXT, expires INTEGER ); # Create the corresponding table class package MyApp::Schema::Session; use base qw/DBIx::Class/; __PACKAGE__->load_components(qw/Core/); __PACKAGE__->table('sessions'); __PACKAGE__->add_columns(qw/id session_data expires/); __PACKAGE__->set_primary_key('id'); 1; # In your application use Catalyst qw/Session Session::Store::DBIC Session::State::Cookie/; __PACKAGE__->config( # ... other items ... 'Plugin::Session' => { dbic_class => 'DBIC::Session', # Assuming MyApp::Model::DBIC expires => 3600, }, ); # Later, in a controller action $c->session->{foo} = 'bar'; =head1 DESCRIPTION This L storage module saves session data in your database via L. It's actually just a wrapper around L; if you need complete control over how your sessions are stored, you probably want to use that instead. =head1 METHODS =head2 setup_finished Hook into the configured session class. =cut sub setup_finished { my $c = shift; return $c->next::method unless @_; # Try to determine id_field if it isn't set unless ($c->_session_plugin_config->{id_field}) { my $model = $c->session_store_model; my $rs = ref $model ? $model : $model->can('resultset_instance') ? $model->resultset_instance : $model; my @primary_columns = $rs->result_source->primary_columns; Catalyst::Exception->throw( message => __PACKAGE__ . qq/: Primary key consists of more than one column; please set id_field manually/ ) if @primary_columns > 1; $c->_session_plugin_config->{id_field} = $primary_columns[0]; } $c->next::method(@_); } =head2 session_store_dbic_class Return the L class name to be passed to C<< $c->model >>. Defaults to C. =cut sub session_store_dbic_class { shift->_session_plugin_config->{dbic_class} || 'DBIC::Session'; } =head2 session_store_dbic_id_field Return the configured ID field name. Defaults to C. =cut sub session_store_dbic_id_field { shift->_session_plugin_config->{id_field} || 'id'; } =head2 session_store_dbic_data_field Return the configured data field name. Defaults to C. =cut sub session_store_dbic_data_field { shift->_session_plugin_config->{data_field} || 'session_data'; } =head2 session_store_dbic_expires_field Return the configured expires field name. Defaults to C. =cut sub session_store_dbic_expires_field { shift->_session_plugin_config->{expires_field} || 'expires'; } =head2 session_store_model Return the model used to find a session. =cut sub session_store_model { my ($c, $id) = @_; my $dbic_class = $c->session_store_dbic_class; $c->model($dbic_class, $id) or die "Couldn't find a model named $dbic_class"; } =head2 get_session_store_delegate Load the row corresponding to the specified session ID. If none is found, one is automatically created. =cut sub get_session_store_delegate { my ($c, $id) = @_; Catalyst::Plugin::Session::Store::DBIC::Delegate->new({ model => $c->session_store_model($id), id_field => $c->session_store_dbic_id_field, data_field => $c->session_store_dbic_data_field, }); } =head2 session_store_delegate_key_to_accessor Match the specified key and operation to the session ID and field name. =cut sub session_store_delegate_key_to_accessor { my $c = shift; my $key = $_[0]; my ($field, @args) = $c->next::method(@_); my ($type) = ($key =~ /^(\w+):/); $field = $c->session_store_dbic_id_field if $field eq 'id'; $field = $c->session_store_dbic_expires_field if $field eq 'expires'; $field = $c->session_store_dbic_data_field if $field eq 'session' or $field eq 'flash'; my $accessor = sub { shift->$type($key)->$field(@_) }; if ($field eq $c->session_store_dbic_data_field) { @args = map { MIME::Base64::encode(Storable::nfreeze($_ || '')) } @args; $accessor = sub { my $value = shift->$type($key)->$field(@_); return unless $value; return Storable::thaw(MIME::Base64::decode($value)); }; } return ($accessor, @args); } =head2 delete_session_data Delete the specified session from the backend store. =cut sub delete_session_data { my ($c, $key) = @_; # expires is stored on the session row for compatibility with Store::DBI return if $key =~ /^expires/; $c->session_store_model->search({ $c->session_store_dbic_id_field => $key, })->delete; return if !$c->_session_store_delegate; my ($field) = split /:/, $key; if ($field eq 'session') { $c->_session_store_delegate->clear_session; } elsif ($field eq 'flash') { $c->_session_store_delegate->clear_flash; } } =head2 delete_expired_sessions Delete all expired sessions. =cut sub delete_expired_sessions { my $c = shift; $c->session_store_model->search({ $c->session_store_dbic_expires_field => { '<', time() }, })->delete; } =head1 CONFIGURATION The following parameters should be placed in your application configuration under the C key. =head2 dbic_class (Required) The name of the L that represents a session in the database. It is recommended that you provide only the part after C, e.g. C. If you are using L, the following layout is recommended: =over 4 =item * C - your L class =item * C - your session table class =item * C - your L class =back This module will then use C<< $c->model >> to access the appropriate result source from the composed schema matching the C name. For more information, please see L. =head2 expires Number of seconds for which sessions are active. Note that no automatic cleanup is done on your session data. To delete expired sessions, you can use the L method with L. =head2 id_field The name of the field on your sessions table which stores the session ID. Defaults to C. =head2 data_field The name of the field on your sessions table which stores session data. Defaults to C for compatibility with L. =head2 expires_field The name of the field on your sessions table which stores the expiration time of the session. Defaults to C. =head1 SCHEMA Your sessions table should contain the following columns: id CHAR(72) PRIMARY KEY session_data TEXT expires INTEGER The C column should probably be 72 characters. It needs to handle the longest string that can be returned by L, plus another eight characters for internal use. This is less than 72 characters when SHA-1 or MD5 is used, but SHA-256 will need all 72 characters. The C column should be a long text field. Session data is encoded using L before being stored in the database. Note that MySQL C fields only store 64 kB, so if your session data will exceed that size you'll want to use C, C, or larger. If you configure your L to include the size of the column, you will receive warnings for this problem: This session requires 1180 bytes of storage, but your database column 'session_data' can only store 200 bytes. Storing this session may not be reliable; increase the size of your data field See L for more information. The C column stores the future expiration time of the session. This may be null for per-user and flash sessions. Note that you can change the column names using the L, L, and L configuration parameters. However, the column types must match the above. =head1 AUTHORS Daniel Westermann-Clark Edanieltwc@cpan.orgE Andrew Rodland Eandrew@cleverdomain.orgE =head1 ACKNOWLEDGMENTS =over 4 =item * Andy Grundman, for L =item * David Kamholz, for most of the testing code (from L) =item * Yuval Kogman, for assistance in converting to L =item * Jay Hannah, for tests and warning when session size exceeds DBIx::Class storage size. =back =head1 COPYRIGHT Copyright (c) 2006 - 2026 the Catalyst::Plugin::Session::Store::DBIC L as listed above. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut 1; DBIC000755001750001750 015235436304 26552 5ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15/lib/Catalyst/Plugin/Session/StoreDelegate.pm100644001750001750 722515235436304 30770 0ustar00andrewandrew000000000000Catalyst-Plugin-Session-Store-DBIC-0.15/lib/Catalyst/Plugin/Session/Store/DBICpackage Catalyst::Plugin::Session::Store::DBIC::Delegate; use strict; use warnings; use base qw/Class::Accessor::Fast/; use Carp qw/carp/; use Scalar::Util qw/blessed/; our $VERSION = '0.15'; # VERSION __PACKAGE__->mk_accessors(qw/model id_field data_field _session_row _flash_row/); =head1 NAME Catalyst::Plugin::Session::Store::DBIC::Delegate - Delegates between the session and flash rows =head1 DESCRIPTION This class delegates between two rows in your sessions table for a given session (session and flash). This is done for compatibility with L. =head1 METHODS =head2 session Return the session row for this delegate. =cut sub session { my ($self, $key) = @_; my $row = $self->_session_row; unless ($row) { $row = $self->_load_row($key); $self->_session_row($row); } return $row; } =head2 flash Return the flash row for this delegate. =cut sub flash { my ($self, $key) = @_; my $row = $self->_flash_row; unless ($row) { $row = $self->_load_row($key); $self->_flash_row($row); } return $row; } =head2 _load_row Load the specified session or flash row from the database. This is a wrapper around L to add support for transactions. =cut sub _load_row { my ($self, $key) = @_; my $load_sub = sub { return $self->model->find_or_create({ $self->id_field => $key }) }; my $row; if (blessed $self->model and $self->model->can('result_source')) { $row = $self->model->result_source->schema->txn_do($load_sub); } else { # Fallback for DBIx::Class::DB $row = $load_sub->(); } return $row; } =head2 expires Return the expires row for this delegate. As with L, this maps to the L row. =cut sub expires { my ($self, $key) = @_; $key =~ s/^expires/session/; $self->session($key); } =head2 flush Update the session and flash data in the backend store. =cut sub flush { my ($self) = @_; for (qw/_session_row _flash_row/) { my $row = $self->$_; next unless $row; # Check the size if available to avoid silent truncation on e.g. MySQL my $data_field = $self->data_field; if (my $size = $row->result_source->column_info($data_field)->{size}) { my $total_size = length($row->$data_field); carp "This session requires $total_size bytes of storage, but your database column '$data_field' can only store $size bytes. Storing this session may not be reliable; increase the size of your data field" if $total_size > $size; } $row->update if $row->in_storage; } $self->_clear_instance_data; } =head2 _clear_instance_data Remove any references held by the delegate. =cut sub _clear_instance_data { my ($self) = @_; $self->id_field(undef); $self->model(undef); $self->_session_row(undef); $self->_flash_row(undef); } =head2 clear_session Deletes the session row for this delegate, forcing a re-fetch on the next access. =cut sub clear_session { my ($self) = @_; $self->_session_row(undef); } =head2 clear_flash Deletes the flash row for this delegate, forcing a re-fetch on the next access. =cut sub clear_flash { my ($self) = @_; $self->_flash_row(undef); } =head1 AUTHOR Daniel Westermann-Clark Edanieltwc@cpan.orgE Andrew Rodland Eandrew@cleverdomain.orgE =head1 COPYRIGHT Copyright 2006-2008 the L as listed above. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut 1;