File Coverage

blib/lib/Armadito/Agent/Tools/Security.pm
Criterion Covered Total %
statement 12 16 75.0
branch 0 2 0.0
condition n/a
subroutine 4 5 80.0
pod 1 1 100.0
total 17 24 70.8


line stmt bran cond sub pod time code
1             package Armadito::Agent::Tools::Security;
2              
3 6     6   1855218 use strict;
  6         11  
  6         161  
4 6     6   24 use warnings;
  6         11  
  6         163  
5 6     6   18 use base 'Exporter';
  6         40  
  6         434  
6 6     6   25 use UNIVERSAL::require();
  6         6  
  6         547  
7              
8             our @EXPORT_OK = qw(
9             isANumber
10             );
11              
12             sub isANumber {
13 0     0 1   my ($unsafe) = @_;
14              
15 0 0         if ( $unsafe !~ /^\d+$/msi ) {
16 0           return 0;
17             }
18 0           return 1;
19             }
20             1;
21              
22             __END__
23              
24             =head1 NAME
25              
26             Armadito::Agent::Tools::Security - Armadito Agent security static subroutines.
27              
28             =head1 DESCRIPTION
29              
30             This module provides validation functions to improve secuity checks in Armadito Agent. It aims to validate tainted variables. See perlsec for further information.
31              
32             =head1 FUNCTIONS
33              
34             =head2 isANumber()
35              
36             Returns true if the input is a number. It means only digits and at least one.