line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::MinFraud::Data::Rx::Type::Hostname; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
32
|
use 5.010; |
|
2
|
|
|
|
|
8
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
13
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
41
|
|
6
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
44
|
|
7
|
2
|
|
|
2
|
|
11
|
use namespace::autoclean; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
12
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '1.010000'; |
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
1057
|
use Data::Validate::Domain qw( is_hostname ); |
|
2
|
|
|
|
|
18024
|
|
|
2
|
|
|
|
|
111
|
|
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
17
|
use parent 'Data::Rx::CommonType::EasyNew'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
13
|
|
14
|
|
|
|
|
|
|
|
15
|
2
|
|
|
2
|
|
119
|
use Role::Tiny::With; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
223
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
with 'WebService::MinFraud::Role::Data::Rx::Type'; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub assert_valid { |
20
|
3
|
|
|
3
|
0
|
540
|
my ( $self, $value ) = @_; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# We use is_hostname rather than is_domain as Net::Domain::TLD cannot keep |
23
|
|
|
|
|
|
|
# up with all of the new gTLDs |
24
|
3
|
100
|
|
|
|
11
|
return 1 if is_hostname($value); |
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
|
|
60
|
$self->fail( |
27
|
|
|
|
|
|
|
{ |
28
|
|
|
|
|
|
|
error => [qw(type)], |
29
|
|
|
|
|
|
|
message => 'Found value is not a valid host name.', |
30
|
|
|
|
|
|
|
value => $value, |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub type_uri { |
36
|
42
|
|
|
42
|
0
|
769
|
'tag:maxmind.com,MAXMIND:rx/hostname'; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# ABSTRACT: A type to check for a valid host name |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=pod |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=encoding UTF-8 |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 NAME |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
WebService::MinFraud::Data::Rx::Type::Hostname - A type to check for a valid host name |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 VERSION |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
version 1.010000 |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 SUPPORT |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Bugs may be submitted through L<https://github.com/maxmind/minfraud-api-perl/issues>. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 AUTHOR |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Mateu Hunter <mhunter@maxmind.com> |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This software is copyright (c) 2015 - 2020 by MaxMind, Inc. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
70
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |