[Catalyst-commits] r8401 - 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
Thu Sep 11 15:22:13 BST 2008
Author: t0m
Date: 2008-09-11 15:22:13 +0100 (Thu, 11 Sep 2008)
New Revision: 8401
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/basic.t
Log:
Checking in changes prior to tagging of version 1.003. Changelog diff is:
=== Changes
==================================================================
--- Changes (revision 7358)
+++ Changes (local)
@@ -1,4 +1,4 @@
-1.003 2008-09-??
+1.003 2008-09-11
- Add ability to override the realm name presented for authentication
when calling $c->authenticate. Documentation and tests for this.
- Clean up documentation of options inherited from
@@ -7,7 +7,8 @@
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)
+ - Document domain option (passed through from $c->authenticate) and add
+ tests for this option.
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/Changes
===================================================================
--- Catalyst-Authentication-Credential-HTTP/1.000/trunk/Changes 2008-09-11 06:10:23 UTC (rev 8400)
+++ Catalyst-Authentication-Credential-HTTP/1.000/trunk/Changes 2008-09-11 14:22:13 UTC (rev 8401)
@@ -1,4 +1,4 @@
-1.003 2008-09-??
+1.003 2008-09-11
- Add ability to override the realm name presented for authentication
when calling $c->authenticate. Documentation and tests for this.
- Clean up documentation of options inherited from
@@ -7,7 +7,8 @@
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)
+ - Document domain option (passed through from $c->authenticate) and add
+ tests for this option.
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/lib/Catalyst/Authentication/Credential/HTTP.pm
===================================================================
--- Catalyst-Authentication-Credential-HTTP/1.000/trunk/lib/Catalyst/Authentication/Credential/HTTP.pm 2008-09-11 06:10:23 UTC (rev 8400)
+++ Catalyst-Authentication-Credential-HTTP/1.000/trunk/lib/Catalyst/Authentication/Credential/HTTP.pm 2008-09-11 14:22:13 UTC (rev 8401)
@@ -13,7 +13,7 @@
__PACKAGE__->mk_accessors(qw/_config realm/);
}
-our $VERSION = "1.002";
+our $VERSION = "1.003";
sub new {
my ($class, $config, $app, $realm) = @_;
@@ -258,7 +258,6 @@
sub _build_auth_header_domain {
my ( $self, $c, $opts ) = @_;
-
if ( my $domain = $opts->{domain} ) {
Catalyst::Exception->throw("domain must be an array reference")
unless ref($domain) && ref($domain) eq "ARRAY";
@@ -275,7 +274,7 @@
sub _build_auth_header_common {
my ( $self, $c, $opts ) = @_;
-
+warn("HERE Opts $opts");
return (
$self->_build_auth_header_realm($c, $opts),
$self->_build_auth_header_domain($c, $opts),
@@ -534,12 +533,12 @@
=item password_type
-The type of password returned by the user object. Same useage as in
+The type of password returned by the user object. Same usage 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
+The name of accessor used to retrieve the value of the password field from the user object. Same usage as in
L<Catalyst::Authentication::Credential::Password|Catalyst::Authentication::Credential::Password/password_field>
=item use_uri_for
Modified: Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/basic.t
===================================================================
--- Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/basic.t 2008-09-11 06:10:23 UTC (rev 8400)
+++ Catalyst-Authentication-Credential-HTTP/1.000/trunk/t/basic.t 2008-09-11 14:22:13 UTC (rev 8401)
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use strict;
use warnings;
-use Test::More tests => 28;
+use Test::More tests => 31;
use Test::MockObject::Extends;
use Test::MockObject;
use Test::Exception;
@@ -127,6 +127,8 @@
is( $body, 'foobar', 'Body is supplied auth message');
}
+# Check undef authorization_required_message suppresses crapping in
+# the body.
$req_headers->clear;
$res_headers->clear;
$c->clear;
@@ -138,4 +140,19 @@
$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
+}
+
+# Check domain config works
+$req_headers->clear;
+$res_headers->clear;
+$c->clear;
+{
+ my $self = new_self( type => 'any', password_type => 'clear',
+ #use_uri_for => 1,
+ );
+ throws_ok {
+ $self->authenticate( $c, $realm, {domain => [qw/dom1 dom2/]} );
+ } qr/^ $Catalyst::DETACH $/x, "detached";
+ like( ($res_headers->header('WWW-Authenticate'))[0], qr/domain="dom1 dom2"/, "WWW-Authenticate header set: digest domains set");
+ like( ($res_headers->header('WWW-Authenticate'))[1], qr/domain="dom1 dom2"/, "WWW-Authenticate header set: basic domains set");
+}
More information about the Catalyst-commits
mailing list