2 use base qw( Exporter );
5 use vars qw( @EXPORT_OK );
7 use FS::UID qw( adminsuidsetup );
10 @EXPORT_OK = qw( rest_auth rest_uri_remain encode_rest );
14 adminsuidsetup('fs_api');
15 my $conf = new FS::Conf;
16 die 'Incorrect shared secret'
17 unless $cgi->param('secret') eq $conf->config('api_shared_secret');
23 #wacky way to get this... surely there must be a better way
25 my $path = $m->request_comp->path;
27 $r->uri =~ /\Q$path\E\/?(.*)$/ or die "$path not in ". $r->uri;
34 #XXX HTTP Accept header to send other formats besides JSON