Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /proc/thread-self/root/usr/share/perl5/vendor_perl/Sentry/Raven/Processor/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/thread-self/root/usr/share/perl5/vendor_perl/Sentry/Raven/Processor/RemoveStackVariables.pm
package Sentry::Raven::Processor::RemoveStackVariables;

use 5.008;
use strict;
use warnings;

=head1 NAME

Sentry::Raven::Processor::RemoveStackVariables - Remove stack variables from stack traces in events

=head1 SYNOPSIS

  use Sentry::Raven;
  use Sentry::Raven::Processor::RemoveStackVariables;

  my $raven = Sentry::Raven->new(
    processors => [ Sentry::Raven::Processor::RemoveStackVariables ],
  );

=head1 DESCRIPTION

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.

=head1 METHODS

=head2 my $processed_event = Sentry::Raven::Processor::RemoveStackVariables->process( $event )

Process an event.

=cut

sub process {
    my ($class, $event) = @_;
    if ($event->{'sentry.interfaces.Stacktrace'}) {
        my $num_frames = scalar(@{$event->{'sentry.interfaces.Stacktrace'}->{frames}});
        delete($event->{'sentry.interfaces.Stacktrace'}->{frames}->[$_]->{vars}) for 0..($num_frames-1);
    }
    return $event;
}

1;

Hry