[Catalyst-commits] r8010 - in
Catalyst-Plugin-DebugCookie/1.000/trunk: . lib/Catalyst/Plugin t
jgoulah at dev.catalyst.perl.org
jgoulah at dev.catalyst.perl.org
Thu Jun 26 23:28:07 BST 2008
Author: jgoulah
Date: 2008-06-26 23:28:07 +0100 (Thu, 26 Jun 2008)
New Revision: 8010
Modified:
Catalyst-Plugin-DebugCookie/1.000/trunk/Makefile.PL
Catalyst-Plugin-DebugCookie/1.000/trunk/lib/Catalyst/Plugin/DebugCookie.pm
Catalyst-Plugin-DebugCookie/1.000/trunk/t/01use.t
Log:
last bit of tweaks for release
Modified: Catalyst-Plugin-DebugCookie/1.000/trunk/Makefile.PL
===================================================================
--- Catalyst-Plugin-DebugCookie/1.000/trunk/Makefile.PL 2008-06-26 16:30:56 UTC (rev 8009)
+++ Catalyst-Plugin-DebugCookie/1.000/trunk/Makefile.PL 2008-06-26 22:28:07 UTC (rev 8010)
@@ -8,6 +8,12 @@
requires 'Digest::MD5';
requires 'Sub::Exporter';
+build_requires 'Test::WWW::Mechanize::Catalyst';
+build_requires 'Catalyst::Plugin::ConfigLoader';
+build_requires 'Catalyst::Plugin::Static::Simple';
+build_requires 'Catalyst::Action::RenderView';
+build_requires 'Config::General';
+
# generate README file
if ($Module::Install::AUTHOR) {
system('pod2text lib/Catalyst/Plugin/DebugCookie.pm > README');
Modified: Catalyst-Plugin-DebugCookie/1.000/trunk/lib/Catalyst/Plugin/DebugCookie.pm
===================================================================
--- Catalyst-Plugin-DebugCookie/1.000/trunk/lib/Catalyst/Plugin/DebugCookie.pm 2008-06-26 16:30:56 UTC (rev 8009)
+++ Catalyst-Plugin-DebugCookie/1.000/trunk/lib/Catalyst/Plugin/DebugCookie.pm 2008-06-26 22:28:07 UTC (rev 8010)
@@ -2,6 +2,7 @@
use strict;
use warnings;
+use 5.008001;
use Class::C3;
use Catalyst::Plugin::DebugCookie::Util qw/check_debug_cookie_value/;
@@ -14,41 +15,46 @@
=head1 SYNOPSIS
- # In your application class
+ # In your application class define the plugin
use Catalyst qw/DebugCookie/;
- # In your controller, a method to set the cookie
+ # In your controller, you must define an action method to set the cookie.
+ # This should be secured by htpasswd or similar methods
use Catalyst::Plugin::DebugCookie::Util qw/make_debug_cookie/;
sub secure_debug_cookie :Path(/this/is/not/public) {
my ($self, $c, $username) = @_;
+ # this method is defined for you in the provided util class
make_debug_cookie($c, $username);
$c->res->body("Cookie set");
}
- # Your config in perl
+ # Your configuration in perl
__PACKAGE__->config->{Plugin::DebugCookie} = {
secret_key => '001A4B28EE3936',
cookie_name => 'mycookie',
}
- # Your config in Config::General format
+ # Or your configuration in L<Config::General> format
<Plugin::DebugCookie>
secret_key 001A4B28EE3936
cookie_name my_secure_debug_cookie
</Plugin::DebugCookie>
- # In your browser set the cookie
- http:///this/is/not/public/username
- # In your browser view a page with debug
- http://yourserver?is_debug=username
+ # In your browser first set the cookie with your username
+ http:///this/is/not/public/<username>
+ # Finally, in your browser view a page with the parameter 'is_debug'
+ # set with the same username used when generating the cookie.
+ # The plugin will turn on debug mode for this request
+ http://yourserver?is_debug=<username>
+
=head1 DESCRIPTION
-Catalyst plugin to turn debug on, typically used in a production
-environment where debug is off. Two things must happen to enable debug.
-First, you have to go to a secure (ideally password protected) URL to
-set the cookie, which is a hash of your secret key and username. Secondly,
+Catalyst plugin to turn debug on a per request basis, typically used in a
+production environment where debug is off by default. Two things must happen
+to enable debug. First, you have to go to a secure (ideally password protected)
+URL to set the cookie, which is a hash of your secret key and username. Secondly,
you have to hit the page with the ?is_debug=<username> query parameter.
Note that this plugin will only work when catalyst debug is off since
@@ -71,7 +77,7 @@
=head2 prepare
-Sets 'X-Catalyst-Debug' and enables stats when debug is on
+Sets 'X-Catalyst-Debug' header and enables stats when debug is on
=cut
sub prepare {
Modified: Catalyst-Plugin-DebugCookie/1.000/trunk/t/01use.t
===================================================================
--- Catalyst-Plugin-DebugCookie/1.000/trunk/t/01use.t 2008-06-26 16:30:56 UTC (rev 8009)
+++ Catalyst-Plugin-DebugCookie/1.000/trunk/t/01use.t 2008-06-26 22:28:07 UTC (rev 8010)
@@ -1,5 +1,5 @@
use strict;
use Test::More tests => 1;
-BEGIN { use_ok('Catalyst::Plugin::AutoRestart') }
+BEGIN { use_ok('Catalyst::Plugin::DebugCookie') }
More information about the Catalyst-commits
mailing list