line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
## Domain Registry Interface, Contact Verification Extension Mapping for EPP |
2
|
|
|
|
|
|
|
## |
3
|
|
|
|
|
|
|
## Copyright (c) 2016 Patrick Mevzek . All rights reserved. |
4
|
|
|
|
|
|
|
## |
5
|
|
|
|
|
|
|
## This file is part of Net::DRI |
6
|
|
|
|
|
|
|
## |
7
|
|
|
|
|
|
|
## Net::DRI is free software; you can redistribute it and/or modify |
8
|
|
|
|
|
|
|
## it under the terms of the GNU General Public License as published by |
9
|
|
|
|
|
|
|
## the Free Software Foundation; either version 2 of the License, or |
10
|
|
|
|
|
|
|
## (at your option) any later version. |
11
|
|
|
|
|
|
|
## |
12
|
|
|
|
|
|
|
## See the LICENSE file that comes with this distribution for more details. |
13
|
|
|
|
|
|
|
#################################################################################################### |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
package Net::DRI::Protocol::EPP::Extensions::ContactVerification; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
864
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
39
|
|
18
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
24
|
|
19
|
1
|
|
|
1
|
|
3
|
use feature 'state'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
52
|
|
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
1
|
|
4
|
use Net::DRI::Util; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
558
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
#################################################################################################### |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub register_commands |
26
|
|
|
|
|
|
|
{ |
27
|
0
|
|
|
0
|
0
|
|
my ($class,$version)=@_; |
28
|
0
|
|
|
|
|
|
state $rcmds = { 'contact' => { 'check' => [ undef, \&check_parse ], |
29
|
|
|
|
|
|
|
'check_multi' => [ undef, \&check_parse ], |
30
|
|
|
|
|
|
|
'info' => [ undef, \&info_parse ], |
31
|
|
|
|
|
|
|
}, |
32
|
|
|
|
|
|
|
}; |
33
|
0
|
|
|
|
|
|
return $rcmds; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub setup |
37
|
|
|
|
|
|
|
{ |
38
|
0
|
|
|
0
|
0
|
|
my ($class,$po,$version)=@_; |
39
|
0
|
|
|
|
|
|
state $rns = { 'vericontact' => [ 'urn:ietf:params:xml:ns:vericontact-1.0','vericontact-1.0.xsd' ] }; |
40
|
0
|
|
|
|
|
|
$po->ns($rns); |
41
|
0
|
|
|
|
|
|
return; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
0
|
0
|
|
sub implements { return 'https://tools.ietf.org/html/draft-wang-eppext-contact-verification-01'; } |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
#################################################################################################### |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub check_parse |
49
|
|
|
|
|
|
|
{ |
50
|
0
|
|
|
0
|
0
|
|
my ($po,$otype,$oaction,$oname,$rinfo)=@_; |
51
|
0
|
|
|
|
|
|
my $mes=$po->message(); |
52
|
0
|
0
|
|
|
|
|
return unless $mes->is_success(); |
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
my $data=$mes->get_extension($mes->ns('vericontact'),'chkData'); |
55
|
0
|
0
|
|
|
|
|
return unless defined $data; |
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
my %r; |
58
|
0
|
|
|
|
|
|
foreach my $el (Net::DRI::Util::xml_list_children($data)) |
59
|
|
|
|
|
|
|
{ |
60
|
0
|
|
|
|
|
|
my ($name,$node)=@$el; |
61
|
0
|
0
|
|
|
|
|
if ($name eq 'distinction') |
62
|
|
|
|
|
|
|
{ |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
$rinfo->{'contact'}->{$node->getAttribute('id')}->{restriction}->{type}=$node->getAttribute('type'); |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
|
return; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub info_parse |
72
|
|
|
|
|
|
|
{ |
73
|
0
|
|
|
0
|
0
|
|
my ($po,$otype,$oaction,$oname,$rinfo)=@_; |
74
|
0
|
|
|
|
|
|
my $mes=$po->message(); |
75
|
0
|
0
|
|
|
|
|
return unless $mes->is_success(); |
76
|
|
|
|
|
|
|
|
77
|
0
|
|
|
|
|
|
my $ns=$mes->ns('vericontact'); |
78
|
0
|
|
|
|
|
|
my $data=$mes->get_extension($ns,'infData'); |
79
|
0
|
0
|
|
|
|
|
return unless defined $data; |
80
|
|
|
|
|
|
|
|
81
|
0
|
|
|
|
|
|
my %r; |
82
|
0
|
|
|
|
|
|
foreach my $el (Net::DRI::Util::xml_list_children($data)) |
83
|
|
|
|
|
|
|
{ |
84
|
0
|
|
|
|
|
|
my ($name,$node)=@$el; |
85
|
0
|
0
|
|
|
|
|
if ($name eq 'status') |
|
|
0
|
|
|
|
|
|
86
|
|
|
|
|
|
|
{ |
87
|
0
|
|
|
|
|
|
$r{status}=$node->textContent(); |
88
|
|
|
|
|
|
|
} elsif ($name eq 'history') |
89
|
|
|
|
|
|
|
{ |
90
|
0
|
|
|
|
|
|
foreach my $record (Net::DRI::Util::xml_list_children($node, 'record')) |
91
|
|
|
|
|
|
|
{ |
92
|
0
|
|
|
|
|
|
push @{$r{history}}, { date => $po->parse_iso8601(Net::DRI::Util::xml_child_content($record, $ns, 'date')), |
|
0
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
op => Net::DRI::Util::xml_child_content($record, $ns, 'op'), |
94
|
|
|
|
|
|
|
clID => Net::DRI::Util::xml_child_content($record, $ns, 'clID'), |
95
|
|
|
|
|
|
|
}; |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
0
|
|
|
|
|
|
$rinfo->{$otype}->{$oname}->{restriction}=\%r; |
101
|
|
|
|
|
|
|
|
102
|
0
|
|
|
|
|
|
return; |
103
|
|
|
|
|
|
|
} |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
#################################################################################################### |
106
|
|
|
|
|
|
|
1; |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
__END__ |