Don't log get_event_list API calls

master
Daniel Berteaud 9 years ago
parent 9002158e85
commit f4523e34e6
  1. 5
      lib/Vroom/Constants.pm
  2. 10
      vroom.pl

@ -4,7 +4,7 @@ use strict;
use warnings;
use base 'Exporter';
our @EXPORT = qw/DB_VERSION COMPONENTS MOH JS_STRINGS API_ACTIONS/;
our @EXPORT = qw/DB_VERSION COMPONENTS MOH JS_STRINGS API_ACTIONS API_NO_LOG/;
# Database version
use constant DB_VERSION => 8;
@ -130,4 +130,7 @@ use constant API_ACTIONS => {
}
};
# List of API actions for which we do not want to log an event
use constant API_NO_LOG => qw(get_event_list);
1;

@ -1590,10 +1590,12 @@ any '/api' => sub {
);
}
$self->log_event({
event => 'api_action_allowed',
msg => "API Key $token calls API action $req->{action}"
});
if (!grep { $_ eq $req->{action} } API_NO_LOG){
$self->log_event({
event => 'api_action_allowed',
msg => "API Key $token calls API action $req->{action}"
});
}
# Here are methods not tied to a room
if ($req->{action} eq 'get_room_list'){

Loading…
Cancel
Save