summaryrefslogtreecommitdiff
path: root/FS/FS/ClientAPI
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2016-03-26 14:37:39 -0700
committerIvan Kohler <ivan@freeside.biz>2016-03-26 14:37:39 -0700
commit3f0cae114021da41286e12688e1542442d1e51a3 (patch)
tree4d20aeb0730200ce583ce21954da7b14526e63e1 /FS/FS/ClientAPI
parenteab8df96e002bf7ba6f1dbd2b68f40432e83fe6a (diff)
webservice infrastructure, RT#33849
Diffstat (limited to 'FS/FS/ClientAPI')
-rw-r--r--FS/FS/ClientAPI/Freeside.pm11
1 files changed, 8 insertions, 3 deletions
diff --git a/FS/FS/ClientAPI/Freeside.pm b/FS/FS/ClientAPI/Freeside.pm
index 90fa55018..dcd3ed6e9 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