line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
## Domain Registry Interface, Domain 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::DomainVerification; |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
809
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
34
|
|
18
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
41
|
|
19
|
1
|
|
|
1
|
|
7
|
use feature 'state'; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
59
|
|
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
1
|
|
5
|
use Net::DRI::Util; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
489
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
#################################################################################################### |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub register_commands |
26
|
|
|
|
|
|
|
{ |
27
|
0
|
|
|
0
|
0
|
|
my ($class,$version)=@_; |
28
|
0
|
|
|
|
|
|
state $rcmds = { 'domain' => { '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 = { 'veridomain' => [ 'urn:ietf:params:xml:ns:veridomain-1.0','veridomain-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-domain-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('veridomain'),'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
|
0
|
|
|
|
|
|
$rinfo->{'domain'}->{lc $node->getAttribute('name')}->{restriction}->{type}=$node->getAttribute('type'); |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
return; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub info_parse |
71
|
|
|
|
|
|
|
{ |
72
|
0
|
|
|
0
|
0
|
|
my ($po,$otype,$oaction,$oname,$rinfo)=@_; |
73
|
0
|
|
|
|
|
|
my $mes=$po->message(); |
74
|
0
|
0
|
|
|
|
|
return unless $mes->is_success(); |
75
|
|
|
|
|
|
|
|
76
|
0
|
|
|
|
|
|
my $ns=$mes->ns('veridomain'); |
77
|
0
|
|
|
|
|
|
my $data=$mes->get_extension($ns,'infData'); |
78
|
0
|
0
|
|
|
|
|
return unless defined $data; |
79
|
|
|
|
|
|
|
|
80
|
0
|
|
|
|
|
|
my %r; |
81
|
0
|
|
|
|
|
|
foreach my $el (Net::DRI::Util::xml_list_children($data)) |
82
|
|
|
|
|
|
|
{ |
83
|
0
|
|
|
|
|
|
my ($name,$node)=@$el; |
84
|
0
|
0
|
|
|
|
|
if ($name eq 'status') |
|
|
0
|
|
|
|
|
|
85
|
|
|
|
|
|
|
{ |
86
|
0
|
|
|
|
|
|
$r{status}=$node->textContent(); |
87
|
|
|
|
|
|
|
} elsif ($name eq 'history') |
88
|
|
|
|
|
|
|
{ |
89
|
0
|
|
|
|
|
|
foreach my $record (Net::DRI::Util::xml_list_children($node, 'record')) |
90
|
|
|
|
|
|
|
{ |
91
|
0
|
|
|
|
|
|
push @{$r{history}}, { date => $po->parse_iso8601(Net::DRI::Util::xml_child_content($record, $ns, 'date')), |
|
0
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
op => Net::DRI::Util::xml_child_content($record, $ns, 'op'), |
93
|
|
|
|
|
|
|
clID => Net::DRI::Util::xml_child_content($record, $ns, 'clID'), |
94
|
|
|
|
|
|
|
}; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
0
|
|
|
|
|
|
$rinfo->{$otype}->{$oname}->{restriction}=\%r; |
100
|
|
|
|
|
|
|
|
101
|
0
|
|
|
|
|
|
return; |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
#################################################################################################### |
105
|
|
|
|
|
|
|
1; |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
__END__ |