[Catalyst-commits] r8618 - in Catalyst-Authentication-Credential-HTTP/1.000/trunk: . lib/Catalyst/Authentication/Credential t

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Wed Nov 19 09:39:56 GMT 2008


Author: t0m
Date: 2008-11-19 09:39:56 +0000 (Wed, 19 Nov 2008)
New Revision: 8618

Modified:
   Catalyst-Authentication-Credential-HTTP/1.000/trunk/Changes
   Catalyst-Authentication-Credential-HTTP/1.000/trunk/lib/Catalyst/Authentication/Credential/HTTP.pm
   Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/04pod_spelling.t
   Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/live_app_digest.t
Log:
Checking in changes prior to tagging of version 1.007.  Changelog diff is:

=== Changes
==================================================================
--- Changes	(revision 8542)
+++ Changes	(local)
@@ -1,6 +1,9 @@
-1.007
-  - Fix warning when used with self_check => 1
-  - Added respository info to META.yml
+1.007  2008-11-19
+  - Add test for query strings in digest auth as digest header is built using
+    the full URI (t0m)
+  - Fix for this (Peter Corlett)
+  - Fix warning when used with self_check => 1 (t0m)
+  - Added respository info to META.yml (t0m)
 
 1.006  2008-10-06
   - Added username_field configuration option. I need this to play


Modified: Catalyst-Authentication-Credential-HTTP/1.000/trunk/Changes
===================================================================
--- Catalyst-Authentication-Credential-HTTP/1.000/trunk/Changes	2008-11-18 21:29:45 UTC (rev 8617)
+++ Catalyst-Authentication-Credential-HTTP/1.000/trunk/Changes	2008-11-19 09:39:56 UTC (rev 8618)
@@ -1,6 +1,9 @@
-1.007
-  - Fix warning when used with self_check => 1
-  - Added respository info to META.yml
+1.007  2008-11-19
+  - Add test for query strings in digest auth as digest header is built using
+    the full URI (t0m)
+  - Fix for this (Peter Corlett)
+  - Fix warning when used with self_check => 1 (t0m)
+  - Added respository info to META.yml (t0m)
 
 1.006  2008-10-06
   - Added username_field configuration option. I need this to play

Modified: Catalyst-Authentication-Credential-HTTP/1.000/trunk/lib/Catalyst/Authentication/Credential/HTTP.pm
===================================================================
--- Catalyst-Authentication-Credential-HTTP/1.000/trunk/lib/Catalyst/Authentication/Credential/HTTP.pm	2008-11-18 21:29:45 UTC (rev 8617)
+++ Catalyst-Authentication-Credential-HTTP/1.000/trunk/lib/Catalyst/Authentication/Credential/HTTP.pm	2008-11-19 09:39:56 UTC (rev 8618)
@@ -13,7 +13,7 @@
     __PACKAGE__->mk_accessors(qw/_config realm/);
 }
 
-our $VERSION = "1.006";
+our $VERSION = "1.007";
 
 sub new {
     my ($class, $config, $app, $realm) = @_;
@@ -101,7 +101,7 @@
         $c->log->debug('Checking authentication parameters.')
           if $c->debug;
 
-        my $uri         = '/' . $c->request->path;
+        my $uri         = $c->request->uri->path_query;
         my $algorithm   = $res{algorithm} || 'MD5';
         my $nonce_count = '0x' . $res{nc};
 
@@ -603,7 +603,7 @@
 Updated to current name space and currently maintained
 by: Tomas Doran C<bobtfish at bobtfish.net>.
 
-Original module by: 
+Original module by:
 
 =over
 
@@ -615,6 +615,16 @@
 
 =back
 
+=head1 CONTRIBUTORS
+
+Patches contributed by:
+
+=over
+
+=item Peter Corlett
+
+=back
+
 =head1 SEE ALSO
 
 RFC 2617 (or its successors), L<Catalyst::Plugin::Cache>, L<Catalyst::Plugin::Authentication>

Modified: Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/04pod_spelling.t
===================================================================
--- Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/04pod_spelling.t	2008-11-18 21:29:45 UTC (rev 8617)
+++ Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/04pod_spelling.t	2008-11-19 09:39:56 UTC (rev 8618)
@@ -26,3 +26,4 @@
 sess
 init
 ok
+Corlett

Modified: Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/live_app_digest.t
===================================================================
--- Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/live_app_digest.t	2008-11-18 21:29:45 UTC (rev 8617)
+++ Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/live_app_digest.t	2008-11-19 09:39:56 UTC (rev 8618)
@@ -12,7 +12,7 @@
     eval { require Cache::FileCache }
       or plan skip_all =>
       "Cache::FileCache is needed for this test";
-    plan tests => 8;
+    plan tests => 12;
 }
 use Digest::MD5;
 use HTTP::Request;
@@ -62,6 +62,7 @@
 
 sub do_test {
     my $username = shift;
+    my $uri = shift;
     my $mech = Test::WWW::Mechanize::Catalyst->new;
     $mech->get("http://localhost/moose");
     is( $mech->status, 401, "status is 401" );
@@ -83,7 +84,7 @@
         my $nc       = '00000001';
         my $method   = 'GET';
         my $qop      = 'auth';
-        my $uri      = '/moose';
+        $uri         ||= '/moose';
         my $ctx = Digest::MD5->new;
         $ctx->add( join( ':', $username, $realm, $password ) );
         my $A1_digest = $ctx->hexdigest;
@@ -97,7 +98,7 @@
 
         $response = qq{Digest username="$username", realm="$realm", nonce="$nonce", uri="$uri", qop=$qop, nc=$nc, cnonce="$cnonce", response="$digest", opaque="$opaque"};
     }
-    my $r = HTTP::Request->new( GET => "http://localhost/moose" );
+    my $r = HTTP::Request->new( GET => "http://localhost" . $uri );
     $mech->request($r);
     $r->headers->push_header( Authorization => $response );
     $mech->request($r);
@@ -106,4 +107,5 @@
 }
 
 do_test('Mufasa');
-do_test('Mufasa2');
\ No newline at end of file
+do_test('Mufasa2');
+do_test('Mufasa', '/moose?moose_id=1'); # Digest auth includes the full URL path, so need to test query strings




More information about the Catalyst-commits mailing list