[Bps-public-commit] RT-Authen-PAUSE branch, master, updated. 0.11-2-gbe227a5

Thomas Sibley trs at bestpractical.com
Fri Mar 1 14:23:46 EST 2013


The branch, master has been updated
       via  be227a5fcdc400c88cf3d0af4ef2bd08be510c49 (commit)
       via  5199632dc653d5ecfde07040540b41a8dfa8fc1a (commit)
      from  9d2d020ba56317a8b0ede0615cc2c5834b9d67f4 (commit)

Summary of changes:
 html/Callbacks/PAUSE/autohandler/Session | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit 5199632dc653d5ecfde07040540b41a8dfa8fc1a
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.
    
    (cherry picked from commit db40a0f288092f3011bfd467c1e4a42819bd682a)

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 be227a5fcdc400c88cf3d0af4ef2bd08be510c49
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.
    
    (cherry picked from commit 0db6d21adc4037633c00d8c7a893dedb613a38bf)

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