# 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
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
. 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
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
-
-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 domain
-=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>
+Array reference to domains used to build the authorization headers.
=back
This should be a hash, and it can contain the following entries:
-=over 4
+=over
=item type
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
#!/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;
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