[freeside-commits] branch FREESIDE_3_BRANCH updated. 3f0cae114021da41286e12688e1542442d1e51a3

Ivan ivan at 420.am
Sat Mar 26 14:37:40 PDT 2016


The branch, FREESIDE_3_BRANCH has been updated
       via  3f0cae114021da41286e12688e1542442d1e51a3 (commit)
      from  eab8df96e002bf7ba6f1dbd2b68f40432e83fe6a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3f0cae114021da41286e12688e1542442d1e51a3
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sat Mar 26 14:37:39 2016 -0700

    webservice infrastructure, RT#33849

diff --git a/FS/FS/ClientAPI/Freeside.pm b/FS/FS/ClientAPI/Freeside.pm
index 90fa550..dcd3ed6 100644
--- a/FS/FS/ClientAPI/Freeside.pm
+++ b/FS/FS/ClientAPI/Freeside.pm
@@ -8,7 +8,7 @@ use FS::svc_external;
 use FS::webservice_log;
 
 #$DEBUG = 0;
-#$me = '[FS::ClientAPI::PrepaidPhone]';
+#$me = '[FS::ClientAPI:Freeside]';
 
 # inputs:
 #   support-key
@@ -17,6 +17,7 @@ use FS::webservice_log;
 #
 # returns:
 #   error (empty, or error message)
+#   custnum
 
 sub freesideinc_service {
   my $packet = shift;
@@ -36,8 +37,12 @@ sub freesideinc_service {
                      '_password' => $_password,
                    },
     'extra_sql' => "AND svcpart = $svcpart",
-  })
-    or return { 'error' => 'bad support-key' };
+  });
+  unless ( $svc_external ) {
+    warn "bad support-key for $username from $ENV{REMOTE_IP}\n";
+    sleep 5; #ideally also rate-limit and eventually ban their IP
+    return { 'error' => 'bad support-key' };
+  }
 
   #XXX check if some customers can use some API calls, rate-limiting, etc.
   # but for now, everybody can use everything

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

Summary of changes:
 FS/FS/ClientAPI/Freeside.pm |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list