X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Authentication-Credential-HTTP-Proxy.git;a=blobdiff_plain;f=lib%2FCatalyst%2FAuthentication%2FCredential%2FHTTP%2FProxy.pm;h=4285290ec1cf772805cd15158a07014f80a550a8;hp=6b16f0e6fc0cd555af4d9c2aa78bed6e9f04c7c5;hb=bbec9b61e82d84f6c04327bb817ffff68688e629;hpb=add8ec98f19b442b577618623b8e77597395aa4b diff --git a/lib/Catalyst/Authentication/Credential/HTTP/Proxy.pm b/lib/Catalyst/Authentication/Credential/HTTP/Proxy.pm index 6b16f0e..4285290 100644 --- a/lib/Catalyst/Authentication/Credential/HTTP/Proxy.pm +++ b/lib/Catalyst/Authentication/Credential/HTTP/Proxy.pm @@ -8,12 +8,16 @@ use String::Escape (); use URI::Escape (); use Catalyst::Authentication::Credential::HTTP::Proxy::User; -our $VERSION = "0.04"; +our $VERSION = "0.05"; + +__PACKAGE__->mk_accessors(qw/ + url +/); sub init { my ($self) = @_; - my $type = $self->_config->{'type'} ||= 'basic'; + my $type = $self->type || 'basic'; if (!$self->_config->{url}) { Catalyst::Exception->throw(__PACKAGE__ . " configuration does not include a 'url' key, cannot proceed"); @@ -22,6 +26,7 @@ sub init { if (!grep /^$type$/, ('basic')) { Catalyst::Exception->throw(__PACKAGE__ . " used with unsupported authentication type: " . $type); } + $self->type($type); } sub authenticate_basic { @@ -34,7 +39,7 @@ sub authenticate_basic { if ( my ( $user, $password ) = $headers->authorization_basic ) { my $ua = Catalyst::Authentication::Credential::HTTP::Proxy::User->new; $ua->credentials($user, $password); - my $resp = $ua->get($self->_config->{url}); + my $resp = $ua->get($self->url); if ( $resp->is_success ) { # Config username_field TODO my $user_obj = $realm->find_user( { username => $user }, $c); @@ -57,6 +62,8 @@ sub authenticate_basic { } } +1; + __END__ =pod @@ -102,7 +109,7 @@ for Catlayst. =head1 DESCRIPTION -This moduule lets you use HTTP Proxy authentication with +This module lets you use HTTP Proxy authentication with L. Currently this module only supports the Basic scheme, but upon request Digest