[Bps-public-commit] RT-Authen-PAUSE branch, rt4, updated. 0.11-4-g0db6d21
Thomas Sibley
trs at bestpractical.com
Fri Mar 1 14:19:58 EST 2013
The branch, rt4 has been updated
via 0db6d21adc4037633c00d8c7a893dedb613a38bf (commit)
via db40a0f288092f3011bfd467c1e4a42819bd682a (commit)
from e2c6521c34fcdfc930a4e70d6715085b199db678 (commit)
Summary of changes:
html/Callbacks/PAUSE/autohandler/Session | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
- Log -----------------------------------------------------------------
commit db40a0f288092f3011bfd467c1e4a42819bd682a
Author: Thomas Sibley <trs at bestpractical.com>
Date: Fri Mar 1 11:15:57 2013 -0800
Report entire HTTP status, not just the response code
The status contains both the HTTP error code and a useful message.
diff --git a/html/Callbacks/PAUSE/autohandler/Session b/html/Callbacks/PAUSE/autohandler/Session
index d9b0886..73e9669 100644
--- a/html/Callbacks/PAUSE/autohandler/Session
+++ b/html/Callbacks/PAUSE/autohandler/Session
@@ -41,11 +41,11 @@ if ($res->code == 200) {
RT::Interface::Web::Redirect( $next )
if $next and $m->request_comp->path eq '/NoAuth/Login.html';
} else {
- $RT::Logger->warning("PAUSE authentication failed with " . $res->code);
+ $RT::Logger->warning("PAUSE authentication failed with " . $res->status_line);
# If 401 then no dice, login failed.
# Other code => oops, PAUSE is down, or something.
- $session{"Actions"}{""} = [loc("Unable to contact PAUSE for authentication (status [_1])", $res->code)]
+ $session{"Actions"}{""} = [loc("Unable to contact PAUSE for authentication ([_1])", $res->status_line)]
if $res->code != 401;
}
commit 0db6d21adc4037633c00d8c7a893dedb613a38bf
Author: Thomas Sibley <trs at bestpractical.com>
Date: Fri Mar 1 11:16:40 2013 -0800
Ensure passwords with non-ASCII characters are correctly handled
RT automatically decodes incoming data, but we need to pass the octets
to LWP not a character string.
diff --git a/html/Callbacks/PAUSE/autohandler/Session b/html/Callbacks/PAUSE/autohandler/Session
index 73e9669..401de19 100644
--- a/html/Callbacks/PAUSE/autohandler/Session
+++ b/html/Callbacks/PAUSE/autohandler/Session
@@ -4,6 +4,7 @@ $pass => undef
</%ARGS>
<%INIT>
use LWP::UserAgent;
+use Encode qw/encode_utf8/;
# somebody is logged in
return if $session{'CurrentUser'} and $session{'CurrentUser'}->Id;
@@ -24,7 +25,7 @@ unless ( $cu->id ) {
# Proxy to PAUSE's auth
my $ua = LWP::UserAgent->new( timeout => 5 );
-$ua->credentials('pause.perl.org:443', 'PAUSE', $user, $pass);
+$ua->credentials('pause.perl.org:443', 'PAUSE', $user, encode_utf8($pass));
my $res = $ua->get('https://pause.perl.org/pause/authenquery');
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list