[Catalyst-commits] r8396 - 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 Sep 10 23:11:23 BST 2008


Author: t0m
Date: 2008-09-10 23:11:23 +0100 (Wed, 10 Sep 2008)
New Revision: 8396

Modified:
   Catalyst-Authentication-Credential-HTTP/1.000/trunk/.shipit
   Catalyst-Authentication-Credential-HTTP/1.000/trunk/Changes
   Catalyst-Authentication-Credential-HTTP/1.000/trunk/Todo
   Catalyst-Authentication-Credential-HTTP/1.000/trunk/lib/Catalyst/Authentication/Credential/HTTP.pm
   Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/basic.t
Log:
Additional documentation and tests for various small features

Modified: Catalyst-Authentication-Credential-HTTP/1.000/trunk/.shipit
===================================================================
--- Catalyst-Authentication-Credential-HTTP/1.000/trunk/.shipit	2008-09-10 15:46:35 UTC (rev 8395)
+++ Catalyst-Authentication-Credential-HTTP/1.000/trunk/.shipit	2008-09-10 22:11:23 UTC (rev 8396)
@@ -1,6 +1,5 @@
 # auto-generated shipit config file.
-steps = FindVersion, ChangeVersion, CheckChangeLog, DistTest
-#, Commit, Tag, MakeDist
+steps = FindVersion, ChangeVersion, CheckChangeLog, DistTest, Commit, Tag, MakeDist
 
 svk.tagpattern =  //mirror/Catalyst-Authentication-Credential-HTTP/1.000/tags/%v
 

Modified: Catalyst-Authentication-Credential-HTTP/1.000/trunk/Changes
===================================================================
--- Catalyst-Authentication-Credential-HTTP/1.000/trunk/Changes	2008-09-10 15:46:35 UTC (rev 8395)
+++ Catalyst-Authentication-Credential-HTTP/1.000/trunk/Changes	2008-09-10 22:11:23 UTC (rev 8396)
@@ -1,10 +1,13 @@
 1.003  2008-09-??
    - Add ability to override the realm name presented for authentication
-     when calling $c->authenticate. Docs and tests for this.
+     when calling $c->authenticate. Documentation and tests for this.
    - Clean up documentation of options inherited from 
-     Catalyst::Authentication::Credential::Password
+     Catalyst::Authentication::Credential::Password.
    - Added an example of calling methods in the credential module from a 
      controller to the POD.
+   - Tests for the authorization_required_message configuration parameter. 
+   - Document use_uri_for configuration option
+   - Document domain option (passed through from $c->authenticate)
 
 1.002  2008-09-03
    - Fix the assumptions that the password field is named password when doing 

Modified: Catalyst-Authentication-Credential-HTTP/1.000/trunk/Todo
===================================================================
--- Catalyst-Authentication-Credential-HTTP/1.000/trunk/Todo	2008-09-10 15:46:35 UTC (rev 8395)
+++ Catalyst-Authentication-Credential-HTTP/1.000/trunk/Todo	2008-09-10 22:11:23 UTC (rev 8396)
@@ -1,9 +1,5 @@
 . Document md5'd passwords for digest stuff
 . Add deprecation notice to old module.
-. document & test authorization_required_message
-. Test $self->_config->{authorization_required_message} + authorization_required_message = undef does not stamp on body.
 . Split auth headers / do auth methods again, and make authenticate call each in turn.
 . Document / test 'algorithm' config.
-. Test and document use_uri_for config
-
-
+. Test and document use_uri_for config & domain

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-09-10 15:46:35 UTC (rev 8395)
+++ Catalyst-Authentication-Credential-HTTP/1.000/trunk/lib/Catalyst/Authentication/Credential/HTTP.pm	2008-09-10 22:11:23 UTC (rev 8396)
@@ -477,16 +477,10 @@
 Sets the HTTP authentication realm presented to the client. Note this does not alter the
 Catalyst::Authentication::Realm object used for the authentication.
 
-=item password_type
+=item domain
 
-The type of password returned by the user object. Same useage as in 
-L<Catalyst::Authentication::Credential::Password|Catalyst::Authentication::Credential::Password/passwprd_type>
+Array reference to domains used to build the authorization headers.
 
-=item password_field
-
-The name of accessor used to retrieve the value of the password field from the user object. Same useage as in 
-L<Catalyst::Authentication::Credential::Password|Catalyst::Authentication::Credential::Password/password_field>
-
 =back
 
 =item authenticate_basic $c, $realm, \%auth_info
@@ -525,7 +519,7 @@
 
 This should be a hash, and it can contain the following entries:
 
-=over 4
+=over
 
 =item type
 
@@ -538,6 +532,21 @@
 
 Set this to a string to override the default body content "Authorization required.", or set to undef to suppress body content being generated.
 
+=item password_type
+
+The type of password returned by the user object. Same useage as in 
+L<Catalyst::Authentication::Credential::Password|Catalyst::Authentication::Credential::Password/passwprd_type>
+
+=item password_field
+
+The name of accessor used to retrieve the value of the password field from the user object. Same useage as in 
+L<Catalyst::Authentication::Credential::Password|Catalyst::Authentication::Credential::Password/password_field>
+
+=item use_uri_for
+
+If this configuration key has a true value, then the domain(s) for the authorization header will be
+run through $c->uri_for()
+
 =back
 
 =head1 RESTRICTIONS

Modified: Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/basic.t
===================================================================
--- Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/basic.t	2008-09-10 15:46:35 UTC (rev 8395)
+++ Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/basic.t	2008-09-10 22:11:23 UTC (rev 8396)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 use strict;
 use warnings;
-use Test::More tests => 24;
+use Test::More tests => 28;
 use Test::MockObject::Extends;
 use Test::MockObject;
 use Test::Exception;
@@ -113,3 +113,29 @@
 like( ($res_headers->header('WWW-Authenticate'))[0], qr/realm="myrealm"/, "WWW-Authenticate header set: digest realm overridden");
 like( ($res_headers->header('WWW-Authenticate'))[1], qr/realm="myrealm"/, "WWW-Authenticate header set: basic realm overridden");
 
+# Check authorization_required_message works
+$req_headers->clear;
+$res_headers->clear;
+$c->clear;
+{
+    my $self = new_self( type => 'any', password_type => 'clear',
+        authorization_required_message => 'foobar'
+    );
+    throws_ok {
+        $self->authenticate( $c, $realm );
+    } qr/^ $Catalyst::DETACH $/x, "detached";
+    is( $body, 'foobar', 'Body is supplied auth message');
+}
+
+$req_headers->clear;
+$res_headers->clear;
+$c->clear;
+{
+    my $self = new_self( type => 'any', password_type => 'clear',
+        authorization_required_message => undef
+    );
+    throws_ok {
+        $self->authenticate( $c, $realm );
+    } qr/^ $Catalyst::DETACH $/x, "detached";
+    is( $body, undef, 'Body is not set - user overrode auth message');
+}
\ No newline at end of file




More information about the Catalyst-commits mailing list