[Bps-public-commit] rt-authen-token branch, master, updated. 59c6dcae5aaf2f8b9eacceed0e0d85670c1587ca

Shawn Moore shawn at bestpractical.com
Wed Jul 19 15:33:00 EDT 2017


The branch, master has been updated
       via  59c6dcae5aaf2f8b9eacceed0e0d85670c1587ca (commit)
       via  82ec4ece7ff6621bf557df8cbf8dfeadb8b61690 (commit)
      from  02a3d67da059b6b573a3a3bd23b50950adb29c12 (commit)

Summary of changes:
 META.yml                                           |  4 ++--
 Makefile.PL                                        |  2 +-
 html/Callbacks/RT-Authen-Token/autohandler/Session | 12 ++++++++++--
 3 files changed, 13 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit 82ec4ece7ff6621bf557df8cbf8dfeadb8b61690
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Wed Jul 19 19:32:19 2017 +0000

    4.2 support using %ENV in place of RequestENV

diff --git a/html/Callbacks/RT-Authen-Token/autohandler/Session b/html/Callbacks/RT-Authen-Token/autohandler/Session
index 38a28fa..4335fd8 100644
--- a/html/Callbacks/RT-Authen-Token/autohandler/Session
+++ b/html/Callbacks/RT-Authen-Token/autohandler/Session
@@ -5,7 +5,15 @@ $pass => ''
 <%INIT>
 return if RT::Interface::Web::_UserLoggedIn();
 
-if ((RT::Interface::Web::RequestENV('HTTP_AUTHORIZATION')||'') =~ /^token (.*)$/i) {
+my $get_env = sub {
+    my $key = shift;
+    if (RT::Interface::Web->can('RequestENV')) {
+        return RT::Interface::Web::RequestENV($key)
+    }
+    return $ENV{$key};
+};
+
+if (($get_env->('HTTP_AUTHORIZATION')||'') =~ /^token (.*)$/i) {
     $pass ||= $1;
 }
 
@@ -15,7 +23,7 @@ my ($user_obj, $token) = RT::Authen::Token->UserForAuthString($pass, $user);
 return unless $user_obj;
 
 # log in
-my $remote_addr = RT::Interface::Web::RequestENV('REMOTE_ADDR');
+my $remote_addr = $get_env->('REMOTE_ADDR');
 $RT::Logger->info("Successful login for @{[$user_obj->Name]} from $remote_addr using authentication token #@{[$token->Id]} (\"@{[$token->Description]}\")");
 
 # It's important to nab the next page from the session before we blow

commit 59c6dcae5aaf2f8b9eacceed0e0d85670c1587ca
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Wed Jul 19 19:32:31 2017 +0000

    4.2.5 is the minimum version
    
    because RT::Date::IsSet

diff --git a/META.yml b/META.yml
index f2036c6..264d548 100644
--- a/META.yml
+++ b/META.yml
@@ -21,10 +21,10 @@ no_index:
     - inc
     - static
 requires:
-  perl: 5.8.3
+  perl: 5.10.1
 resources:
   license: http://opensource.org/licenses/gpl-license.php
 version: 0.01
 x_module_install_rtx_version: 0.39
-x_requires_rt: 4.2
+x_requires_rt: 4.2.5
 x_rt_too_new: 4.6
diff --git a/Makefile.PL b/Makefile.PL
index 022f658..38829ab 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -2,7 +2,7 @@ use inc::Module::Install;
 
 RTx 'RT-Authen-Token';
 
-requires_rt '4.2';
+requires_rt '4.2.5';
 rt_too_new '4.6';
 
 WriteAll;

-----------------------------------------------------------------------


More information about the Bps-public-commit mailing list