[freeside-commits] branch FREESIDE_4_BRANCH updated. 4426278dd2f0c1f037cb67eb23d43be2a68b6224

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


The branch, FREESIDE_4_BRANCH has been updated
       via  4426278dd2f0c1f037cb67eb23d43be2a68b6224 (commit)
      from  b7fcb9f53c2f6170d1f403e38a9ee9f1fa6f723a (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 4426278dd2f0c1f037cb67eb23d43be2a68b6224
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sat Mar 26 14:37:38 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