| 1 | ## Domain Registry Interface, CZ domain transactions extension | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | ## | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | ## Copyright (c) 2008-2010,2013 Tonnerre Lombard <tonnerre.lombard@sygroup.ch>. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | ## 2018 Patrick Mevzek <netdri@dotandco.com> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | ## All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | ## | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | ## This file is part of Net::DRI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | ## | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | ## Net::DRI is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | ## it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | ## the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | ## (at your option) any later version. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | ## | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | ## See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | package Net::DRI::Protocol::EPP::Extensions::CZ::Domain; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 1 | ▶ | use Net::DRI::Util; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 1 | ▶ | use Net::DRI::Exception; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 1 | ▶ | use Net::DRI::Data::ContactSet; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 1 | ▶ | use Net::DRI::Data::Hosts; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 1 | ▶ | use Net::DRI::Protocol::EPP::Util; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 1 | ▶ | use DateTime::Format::ISO8601; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | =pod | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | Net::DRI::Protocol::EPP::Extensions::CZ::Domain - .CZ Domain extension commands for Net::DRI | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | Please see the README file for details. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | =head1 SUPPORT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | For now, support questions should be sent to: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | E<lt>development@sygroup.chE<gt> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | Please also see the SUPPORT file in the distribution. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | =head1 SEE ALSO | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | E<lt>http://oss.bsdprojects.net/projects/netdri/E<gt> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | Tonnerre Lombard, E<lt>tonnerre.lombard@sygroup.chE<gt> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | Copyright (c) 2008-2010,2013 Tonnerre Lombard <tonnerre.lombard@sygroup.ch>. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 2018 Patrick Mevzek <netdri@dotandco.com> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | This program is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | (at your option) any later version. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | =cut | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | sub register_commands | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 0 | ▶ | my ($class, $version) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
register_commands: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 0 | my %tmp = ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | info => [ \&info, \&info_parse ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | create => [ \&create, undef ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | update => [ \&update ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | return { 'domain' => \%tmp }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | ################################################################################################## | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | sub build_command | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 0 | ▶ | my ($msg, $command, $domain, $domainattr) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
build_command: not called CC=9 SCAR=45.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | ▶ | my @dom = (ref($domain)) ? @$domain : ($domain); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 0 | ▶ | Net::DRI::Exception->die(1, 'protocol/EPP', 2, "Domain name needed") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | unless @dom; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 0 | foreach my $d (@dom) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 0 | ▶ | Net::DRI::Exception->die(1, 'protocol/EPP', 2, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
defined $d and $d and not ref $d
defined $d and $d
MC/DC0%0/3
defined $d and $d and not ref $d
defined $d
$d
not ref $d
Truth table0%0/4
A and B and not(C)
A= defined $dB= $dC= not ref $d
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 'Domain name needed') unless (defined($d) && $d && !ref($d)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 0 | ▶ | Net::DRI::Exception->die(1, 'protocol/EPP', 10, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 'Invalid domain name: ' . $d) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | unless (Net::DRI::Util::is_hostname($d)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 0 | ▶ | my $tcommand = (ref($command)) ? $command->[0] : $command; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | $msg->command([$command, 'domain:' . $tcommand, $msg->nsattrs('domain')]); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | my @d = map { ['domain:name', $_, $domainattr] } @dom; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 0 | return @d; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | sub build_authinfo | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 0 | ▶ | my $rauth = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
build_authinfo: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | return ['domain:authInfo', $rauth->{pw}]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | ########### Query commands | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | sub info | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | ▶ | my ($epp, $domain, $rd) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
info: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 0 | my $mes = $epp->message(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 0 | my @d = build_command($mes, 'info', $domain); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 0 | ▶ | push(@d, build_authinfo($rd->{auth})) if Net::DRI::Util::has_auth($rd); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 0 | $mes->command_body(\@d); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | sub info_parse | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | ▶ | my ($po, $otype, $oaction, $oname, $rinfo) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
info_parse: not called CC=20 SCAR=60.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | my $mes = $po->message(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 0 | my $infdata = $mes->get_response('domain','infData'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 0 | ▶ | return unless $infdata; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | my (@s, @host, $ns); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 0 | my $cs = Net::DRI::Data::ContactSet->new(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | my $c = $infdata->getFirstChild(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | ▶ | while ($c) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 0 | ▶ | my $name = $c->localname() || $c->nodeName(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$c->localname || $c->nodeName
MC/DC0%0/2
$c->localname || $c->nodeName
$c->localname
$c->nodeName
Truth table0%0/3
A || B
A= $c->localnameB= $c->nodeName
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | 0 | ▶ | next unless $name; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | ▶ | if ($name eq 'name') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 10 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | 0 | $oname = lc($c->getFirstChild()->getData()); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 0 | $rinfo->{domain}->{$oname}->{action} = 'info'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | $rinfo->{domain}->{$oname}->{exist} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | elsif ($name eq 'roid') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | $rinfo->{domain}->{$oname}->{roid} = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 0 | $c->getFirstChild()->getData(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | elsif ($name eq 'status') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 0 | push(@s, Net::DRI::Protocol::EPP::Util::parse_node_status($c)); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | elsif ($name =~ /^(registrant|admin)$/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 0 | $cs->set($po->create_local_object('contact')->srid($c->getFirstChild()->getData()), | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | $1); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | elsif ($name eq 'ns') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 0 | ▶ | $ns = Net::DRI::Data::Hosts->new() if (!$ns); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 0 | $ns->add($c->getFirstChild()->getData()); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | elsif ($name eq 'nsset') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | $rinfo->{domain}->{$oname}->{nsset} = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 0 | $c->getFirstChild()->getData(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | elsif ($name eq 'host') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 0 | push(@host, $c->getFirstChild()->getData()); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | elsif ($name =~ m/^(clID|crID|upID)$/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | $rinfo->{domain}->{$oname}->{$1} = | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | $c->getFirstChild()->getData(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | elsif ($name =~ m/^(crDate|upDate|trDate|exDate)$/) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 0 | $rinfo->{domain}->{$oname}->{$1} = | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | DateTime::Format::ISO8601->new()-> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | parse_datetime($c->getFirstChild()-> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | getData()); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | elsif ($name eq 'authInfo') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | 0 | my $pw = $c->getFirstChild()->getData(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | $rinfo->{domain}->{$oname}->{auth} = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 0 | ▶ | {pw => ($pw ? $pw : undef) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | 0 | $c = $c->getNextSibling(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | 0 | $rinfo->{domain}->{$oname}->{contact} = $cs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 0 | $rinfo->{domain}->{$oname}->{status} = $po-> | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | create_local_object('status')->add(@s); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 0 | ▶ | $rinfo->{domain}->{$oname}->{host} = Net::DRI::Data::Hosts-> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | new_set(@host) if (@host); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | 0 | ▶ | $rinfo->{domain}->{$oname}->{ns} = $ns if ($ns); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | ############ Transform commands | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | sub create | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | ▶ | my ($epp, $domain, $rd) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create: not called CC=14 SCAR=53.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 0 | my $mes = $epp->message(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 0 | my @d = build_command($mes, 'create', $domain); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | 0 | my $def = $epp->default_parameters(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | 0 | ▶ | if ($def && (ref($def) eq 'HASH') && exists($def->{domain_create}) && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
$def and ref $def eq "HASH" and exists $def->{"domain_create"} and ref $def->{"domain_create"} eq "HASH"
$def and ref $def eq "HASH" and exists $def->{"domain_create"}
$def and ref $def eq "HASH"
MC/DC0%0/4
$def and ref $def eq "HASH" and exists $def->{"domain_create"} and ref $def->{"domain_create"} eq "HASH"
$def
ref $def eq "HASH"
exists $def->{"domain_create"}
ref $def->{"domain_create"} eq "HASH"
Truth table0%0/5
A and B and C and D
A= $defB= ref $def eq "HASH"C= exists $def->{"domain_create"}D= ref $def->{"domain_create"} eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | (ref($def->{domain_create}) eq 'HASH')) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | ▶ | $rd = {} unless ($rd && (ref($rd) eq 'HASH') && keys(%$rd)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$rd and ref $rd eq "HASH" and keys %$rd
$rd and ref $rd eq "HASH"
MC/DC0%0/3
$rd and ref $rd eq "HASH" and keys %$rd
$rd
ref $rd eq "HASH"
keys %$rd
Truth table0%0/4
A and B and C
A= $rdB= ref $rd eq "HASH"C= keys %$rd
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 0 | ▶ | while (my ($k, $v) = each(%{$def->{domain_create}})) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 0 | ▶ | next if exists($rd->{$k}); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | 0 | $rd->{$k} = $v; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | ## Period, OPTIONAL | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | 0 | ▶ | push(@d, Net::DRI::Protocol::EPP::Util::build_period($rd->{duration})) if Net::DRI::Util::has_duration($rd); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | ## Nameserver sets, OPTIONAL | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 0 | ▶ | push(@d, ['domain:nsset', $rd->{nsset}]) if (Net::DRI::Util::has_key($rd, 'nsset')); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | ## Contacts, all OPTIONAL | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | 0 | ▶ | push(@d, build_contacts($rd->{contact})) if (Net::DRI::Util::has_contact($rd)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | ## AuthInfo | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('authInfo is ' . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 'mandatory') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | unless (Net::DRI::Util::has_auth($rd)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | 0 | push(@d, build_authinfo($rd->{auth})); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 0 | $mes->command_body(\@d); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | sub build_contacts | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | 0 | ▶ | my $cs = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
build_contacts: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | 0 | my @d; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | 0 | foreach my $t (sort { $b cmp $a } $cs->types()) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | 0 | my @o = $cs->get($t); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | 0 | push(@d, map { ['domain:' . $t, $_->srid()] } @o); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 0 | return @d; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | sub update | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | 0 | ▶ | my ($epp, $domain, $todo) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
update: not called CC=22 SCAR=62.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | 0 | my $mes = $epp->message(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters($todo . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | ' must be a Net::DRI::Data::Changes object') unless | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | Net::DRI::Util::isa_changes($todo); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | 0 | ▶ | if ((grep { ! /^(?:add|del)$/ } $todo->types('ns')) || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
grep {not /^(?:add|del)$/;} $todo->types("ns") or grep {not /^(?:add|del)$/;} $todo->types("status") or grep {not /^(?:add|del)$/;} $todo->types("contact") or grep {not /^set$/;} $todo->types("auth")
grep {not /^(?:add|del)$/;} $todo->types("ns") or grep {not /^(?:add|del)$/;} $todo->types("status") or grep {not /^(?:add|del)$/;} $todo->types("contact")
grep {not /^(?:add|del)$/;} $todo->types("ns") or grep {not /^(?:add|del)$/;} $todo->types("status")
MC/DC0%0/4
grep {not /^(?:add|del)$/;} $todo->types("ns") or grep {not /^(?:add|del)$/;} $todo->types("status") or grep {not /^(?:add|del)$/;} $todo->types("contact") or grep {not /^set$/;} $todo->types("auth")
grep {not /^(?:add|del)$/;} $todo->types("ns")
grep {not /^(?:add|del)$/;} $todo->types("status")
grep {not /^(?:add|del)$/;} $todo->types("contact")
grep {not /^set$/;} $todo->types("auth")
Truth table0%0/5
A or B or C or D
A= grep {not /^(?:add|del)$/;} $todo->types("ns")B= grep {not /^(?:add|del)$/;} $todo->types("status")C= grep {not /^(?:add|del)$/;} $todo->types("contact")D= grep {not /^set$/;} $todo->types("auth")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | 0 | (grep { ! /^(?:add|del)$/ } $todo->types('status')) || | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | 0 | (grep { ! /^(?:add|del)$/ } $todo->types('contact')) || | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | 0 | (grep { ! /^set$/ } $todo->types('auth'))) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | 0 | Net::DRI::Exception->die(0, 'protocol/EPP', 11, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | 'Only ns/status/contact add/del or registrant/' . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 'authinfo set available for domain'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | 0 | my @d = build_command($mes, 'update', $domain); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | 0 | my $nsadd = $todo->add('ns'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | 0 | my $nsdel = $todo->del('ns'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | 0 | my $sadd = $todo->add('status'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | 0 | my $sdel = $todo->del('status'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | 0 | my $cadd = $todo->add('contact'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | 0 | my $cdel = $todo->del('contact'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | 0 | my (@add, @del); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | 0 | ▶ | push(@add, Net::DRI::Protocol::EPP::Util::build_ns($epp, $nsadd, $domain)) if ($nsadd && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$nsadd and not $nsadd->is_empty
MC/DC0%0/2
$nsadd and not $nsadd->is_empty
$nsadd
not $nsadd->is_empty
Truth table0%0/3
A and not(B)
A= $nsaddB= not $nsadd->is_empty
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | !$nsadd->is_empty()); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | 0 | ▶ | push(@add, build_contacts($cadd)) if ($cadd); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | 0 | ▶ | push(@add, $sadd->build_xml('domain:status', 'core')) if ($sadd); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | 0 | ▶ | push(@del, Net::DRI::Protocol::EPP::Util::build_ns($epp, $nsdel, $domain)) if ($nsdel && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$nsdel and not $nsdel->is_empty
MC/DC0%0/2
$nsdel and not $nsdel->is_empty
$nsdel
not $nsdel->is_empty
Truth table0%0/3
A and not(B)
A= $nsdelB= not $nsdel->is_empty
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | !$nsdel->is_empty()); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | 0 | ▶ | push(@del, build_contacts($cdel)) if ($cdel); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | 0 | ▶ | push(@del, $sdel->build_xml('domain:status', 'core')) if ($sdel); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | 0 | ▶ | push(@d, ['domain:add', @add]) if (@add); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | 0 | ▶ | push(@d, ['domain:rem', @del]) if (@del); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | 0 | my @chg; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | 0 | my $chg = $todo->set('nsset'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | 0 | ▶ | push(@chg, ['domain:nsset', $chg]) if (defined($chg) && length($chg)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $chg and length $chg
MC/DC0%0/2
defined $chg and length $chg
defined $chg
length $chg
Truth table0%0/3
A and B
A= defined $chgB= length $chg
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | 0 | $chg = $todo->set('registrant'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | 0 | ▶ | push(@chg, ['domain:registrant', $chg->srid()]) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | if Net::DRI::Util::isa_contact($chg); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | 0 | $chg = $todo->set('auth'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | 0 | ▶ | push(@chg, build_authinfo($chg)) if ($chg && ref($chg)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$chg and ref $chg
MC/DC0%0/2
$chg and ref $chg
$chg
ref $chg
Truth table0%0/3
A and B
A= $chgB= ref $chg
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | 0 | ▶ | push(@d, ['domain:chg', @chg]) if (@chg); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | 0 | $mes->command_body(\@d); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||