Don't log get_event_list API calls

This commit is contained in:
Daniel Berteaud 2015-07-13 19:58:38 +02:00
parent 9002158e85
commit f4523e34e6
2 changed files with 10 additions and 5 deletions

View File

@ -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;

View File

@ -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'){