line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Sentry::Raven::Processor::RemoveStackVariables; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
530
|
use 5.008; |
|
1
|
|
|
|
|
4
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
5
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
142
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Sentry::Raven::Processor::RemoveStackVariables - Remove stack variables from stack traces in events |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 SYNOPSIS |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
use Sentry::Raven; |
14
|
|
|
|
|
|
|
use Sentry::Raven::Processor::RemoveStackVariables; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my $raven = Sentry::Raven->new( |
17
|
|
|
|
|
|
|
processors => [ Sentry::Raven::Processor::RemoveStackVariables ], |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 DESCRIPTION |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
This processor removes variables from stack traces before they are posted to the sentry service. This prevents sensitive values from being exposed, such as passwords or credit card numbers. |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 METHODS |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head2 my $processed_event = Sentry::Raven::Processor::RemoveStackVariables->process( $event ) |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
Process an event. |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=cut |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub process { |
33
|
1
|
|
|
1
|
1
|
5
|
my ($class, $event) = @_; |
34
|
1
|
50
|
|
|
|
31
|
if ($event->{'sentry.interfaces.Stacktrace'}) { |
35
|
1
|
|
|
|
|
4
|
my $num_frames = scalar(@{$event->{'sentry.interfaces.Stacktrace'}->{frames}}); |
|
1
|
|
|
|
|
7
|
|
36
|
1
|
|
|
|
|
9
|
delete($event->{'sentry.interfaces.Stacktrace'}->{frames}->[$_]->{vars}) for 0..($num_frames-1); |
37
|
|
|
|
|
|
|
} |
38
|
1
|
|
|
|
|
3
|
return $event; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |