DRI/Protocol/EPP/Extensions/NO/Domain.pm

filter: Statementstmt 14.5% 25 / 172 Branchbran 0.0% 0 / 94 Conditioncond 0.0% 0 / 126 MC/DCmcdc 0.0% 0 / 66 Subroutinesub 44.4% 8 / 18 Podpod 0.0% 0 / 10 totaltotal 6.7% 33 / 486 CC 92 SCAR 55.5
CC
92
Cov
6%
delete
650.0
transfer_execute
306.0
transfer_request
210.0
CRAP 257.3
« DRI/Protocol/RRI/Contact.pm ↑ Summary DRI/Protocol/EPP/Extensions/CoCCA/IPVerification.pm »
1 ## Domain Registry Interface, .NO Domain extensions
2 ##
3 ## Copyright (c) 2008-2010,2013-2014,2019 UNINETT Norid AS, E<lt>http://www.norid.noE<gt>,
4 ## Trond Haugen E<lt>info@norid.noE<gt>
5 ## (c) 2016,2018-2019 Patrick Mevzek E<lt>netdri@dotandco.comE<gt>
6 ## All rights reserved.
7 ##
8 ## This file is part of Net::DRI
9 ##
10 ## Net::DRI is free software; you can redistribute it and/or modify
11 ## it under the terms of the GNU General Public License as published by
12 ## the Free Software Foundation; either version 2 of the License, or
13 ## (at your option) any later version.
14 ##
15 ## See the LICENSE file that comes with this distribution for more details.
16 ####################################################################################################
17  
18 package Net::DRI::Protocol::EPP::Extensions::NO::Domain;
19  
20 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 1 ▶use Net::DRI::DRD::NORID;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 1 ▶use Net::DRI::Protocol::EPP::Core::Domain;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 1 ▶use Net::DRI::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 1 ▶use Net::DRI::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 1 ▶use Net::DRI::Protocol::EPP::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
28 1 ▶use Net::DRI::Protocol::EPP::Extensions::NO::Host;
Subroutine BEGIN: called CC=1 SCAR=0.0
29  
30 =pod
31  
32 =head1 NAME
33  
34 Net::DRI::Protocol::EPP::Extensions::NO::Domain - .NO EPP 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>netdri@dotandco.comE<gt>
45  
46 Please also see the SUPPORT file in the distribution.
47  
48 =head1 SEE ALSO
49  
50 E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
51  
52 =head1 AUTHOR
53  
54 Trond Haugen, E<lt>info@norid.noE<gt>
55  
56 =head1 COPYRIGHT
57  
58 Copyright (c) 2008-2010,2013-2014,2019 UNINETT Norid AS, E<lt>http://www.norid.noE<gt>,
59 Trond Haugen E<lt>info@norid.noE<gt>
60 (c) 2016,2018-2019 Patrick Mevzek E<lt>netdri@dotandco.comE<gt>
61 All rights reserved.
62  
63 This program is free software; you can redistribute it and/or modify
64 it under the terms of the GNU General Public License as published by
65 the Free Software Foundation; either version 2 of the License, or
66 (at your option) any later version.
67  
68 See the LICENSE file that comes with this distribution for more details.
69  
70 =cut
71  
72 ####################################################################################################
73  
74 0 ▶sub register_commands {
Subroutine register_commands: not called CC=1 SCAR=6.9
Pod undocumented
75 0 my ( $class, $version ) = @_;
76 0 my %tmp = (
77 check => [ \&facet, undef ],
78 info => [ \&facet, \&parse_info ],
79 transfer_cancel => [ \&facet, undef ],
80 transfer_query => [ \&facet, undef ],
81 renew => [ \&facet, undef ],
82  
83 create => [ \&create, undef ],
84 update => [ \&update, undef ],
85 delete => [ \&delete, undef ],
86 transfer_request => [ \&transfer_request, undef ],
87 transfer_execute => [
88 \&transfer_execute,
89 \&Net::DRI::Protocol::EPP::Core::Domain::transfer_parse
90 ],
91 withdraw => [ \&withdraw, undef ],
92 );
93 0 return { 'domain' => \%tmp };
94 }
95  
96 ####################################################################################################
97  
98 0 ▶sub facet {
Subroutine facet: not called CC=1 SCAR=6.9
Pod undocumented
99 0 my ( $epp, $o, $rd ) = @_;
100  
101 0 return Net::DRI::Protocol::EPP::Extensions::NO::Host::build_facets( $epp, $rd );
102 }
103  
104 0 ▶sub applicant_dataset {
Subroutine applicant_dataset: not called CC=10 SCAR=47.0
Pod undocumented
105 0 my ( $epp, $command, $rd ) = @_;
106  
107 0 my @e;
108  
109 0 ▶ return unless ( ref $rd eq 'HASH' && defined $rd->{applicantdataset} && keys %{$rd->{applicantdataset}} );
Branch: 1 branch
BranchTrueFalseTotal
unless ref $rd eq "HASH" and defined $rd->{"applicantdataset"} and keys %{$$rd{"applicantdataset"};} 0 0 0
Condition0%0/6
ref $rd eq "HASH" and defined $rd->{"applicantdataset"} and keys %{$$rd{"applicantdataset"};}
!ll&&!rl&&r
000
ref $rd eq "HASH" and defined $rd->{"applicantdataset"}
!ll&&!rl&&r
000
MC/DC0%0/3
ref $rd eq "HASH" and defined $rd->{"applicantdataset"} and keys %{$$rd{"applicantdataset"};}
ref $rd eq "HASH" defined $rd->{"applicantdataset"} keys %{$$rd{"applicantdataset"};}
Truth table0%0/4
A and B and C
A= ref $rd eq "HASH"B= defined $rd->{"applicantdataset"}C= keys %{$$rd{"applicantdataset"};}
ABCresult
0XX0
10X0
1100
1111
110  
111 0 ▶ return unless ($command eq 'create' || $command eq 'update');
Branch: 1 branch
BranchTrueFalseTotal
unless $command eq "create" or $command eq "update" 0 0 0
Condition0%0/3
$command eq "create" or $command eq "update"
l!l&&r!l&&!r
000
MC/DC0%0/2
$command eq "create" or $command eq "update"
$command eq "create" $command eq "update"
Truth table0%0/3
A or B
A= $command eq "create"B= $command eq "update"
ABresult
1X1
011
000
112  
113 0 my $r = $rd->{applicantdataset};
114  
115 # Check precense of all mandatory elements.
116 # All fields except registrarref are required to have a value.
117 0 foreach my $el ( qw / versionnumber acceptname acceptdate /) {
118 0 ▶ unless ( $r->{$el} ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($r->{$el}) 0 0 0
119 0 Net::DRI::Exception->die(0,'protocol/EPP',1,"applicantdataset is missing a mandatory element: $el");
120 }
121 }
122  
123 0 my $versionnumber = $r->{versionnumber};
124 0 my $acceptname = $r->{acceptname};
125 0 my $acceptdate = $r->{acceptdate};
126  
127 0 my @te;
128 0 push @te, [ "no-ext-domain:versionNumber", $versionnumber ];
129 0 push @te, [ "no-ext-domain:acceptName" , $acceptname ];
130 0 push @te, [ "no-ext-domain:acceptDate" , $acceptdate ];
131  
132 0 ▶ if ($command eq 'create') {
Branch: 2 branches
BranchTrueFalseTotal
if ($command eq 'create') { } 0 0 0
elsif ($command eq 'update') { } 0 0 0
133 0 push @e, [ 'no-ext-domain:applicantDataset', @te ];
134 } elsif ($command eq 'update') {
135 0 push @e, [ 'no-ext-domain:chg', [ 'no-ext-domain:applicantDataset', @te ] ];
136 }
137 0 $epp->message()->command_extension( 'no-ext-domain', [ $command, @e ] );
138 0 return;
139 }
140  
141 0 ▶sub parse_info {
Subroutine parse_info: not called CC=9 SCAR=45.0
Pod undocumented
142 0 my ( $po, $otype, $oaction, $oname, $rinfo ) = @_;
143 0 my $mes = $po->message();
144 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
145  
146 0 my $NS = $mes->ns('no-ext-domain');
147  
148 0 my $c = $rinfo->{domain}->{$oname}->{self};
149  
150 0 my $adata = $mes->get_extension('no-ext-domain','infData');
151  
152 0 ▶ return unless $adata;
Branch: 1 branch
BranchTrueFalseTotal
unless $adata 0 0 0
153  
154 0 for my $t ('versionNumber', 'acceptName', 'acceptDate', 'updateClientID', 'updateDate') {
155 0 my $el = $adata->getElementsByTagNameNS( $NS, $t );
156 0 ▶ my $v = $el ? $el->get_node(1)->getFirstChild()->getData() : undef;
Branch: 1 branch
BranchTrueFalseTotal
$el ? : 0 0 0
157 # Transform the dates to date objects
158 0 ▶ if (defined $v && $v && ($t eq 'acceptDate' || $t eq 'updateDate')) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $v and $v and $t eq "acceptDate" || $t eq "updateDate") 0 0 0
Condition0%0/9
defined $v and $v and $t eq "acceptDate" || $t eq "updateDate"
!ll&&!rl&&r
000
defined $v and $v
!ll&&!rl&&r
000
$t eq "acceptDate" or $t eq "updateDate"
l!l&&r!l&&!r
000
MC/DC0%0/4
defined $v and $v and $t eq "acceptDate" || $t eq "updateDate"
defined $v $v $t eq "acceptDate" $t eq "updateDate"
Truth table0%0/5
A and B and C or D
A= defined $vB= $vC= $t eq "acceptDate"D= $t eq "updateDate"
ABCDresult
0XXX0
10XX0
11000
111X1
11011
159 0 $v = $po->parse_iso8601($v);
160 }
161 0 $rinfo->{domain}->{$oname}->{applicantDataset}->{$t} = $v;
162 }
163 0 return;
164 }
165  
166 0 ▶sub create {
Subroutine create: not called CC=8 SCAR=42.8
Pod undocumented
167 0 my ( $epp, $domain, $rd ) = @_;
168  
169 0 my $fs = $rd->{facets};
170 0 my $ds = $rd->{applicantdataset};
171  
172 0 ▶ return unless ( defined($fs) && $fs || defined($ds) && $ds );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $fs and $fs or defined $ds and $ds 0 0 0
Condition0%0/9
defined $fs and $fs or defined $ds and $ds
l!l&&r!l&&!r
000
defined $fs and $fs
!ll&&!rl&&r
000
defined $ds and $ds
!ll&&!rl&&r
000
MC/DC0%0/4
defined $fs and $fs or defined $ds and $ds
defined $fs $fs defined $ds $ds
Truth table0%0/7
A and B or C and D
A= defined $fsB= $fsC= defined $dsD= $ds
ABCDresult
11XX1
0X111
10111
0X0X0
0X100
100X0
10100
173  
174 0 my $r;
175  
176 0 ▶ if (defined($ds) && $ds) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $ds and $ds) 0 0 0
Condition0%0/3
defined $ds and $ds
!ll&&!rl&&r
000
MC/DC0%0/2
defined $ds and $ds
defined $ds $ds
Truth table0%0/3
A and B
A= defined $dsB= $ds
ABresult
0X0
100
111
177 0 $r = applicant_dataset($epp, 'create', $rd);
178 }
179  
180 0 ▶ if ($fs) {
Branch: 1 branch
BranchTrueFalseTotal
if ($fs) 0 0 0
181 0 my $rd;
182 0 $rd->{facets} = $fs;
183 0 $r = facet($epp, $domain, $rd);
184 }
185 0 return $r;
186 }
187  
188  
189 0 ▶sub update {
Subroutine update: not called CC=8 SCAR=42.8
Pod undocumented
190 0 my ( $epp, $domain, $todo ) = @_;
191  
192 0 my $fs = $todo->set('facets');
193 0 my $ds = $todo->set('applicantdataset');
194  
195 0 ▶ return unless ( defined($fs) && $fs || defined($ds) && $ds );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $fs and $fs or defined $ds and $ds 0 0 0
Condition0%0/9
defined $fs and $fs or defined $ds and $ds
l!l&&r!l&&!r
000
defined $fs and $fs
!ll&&!rl&&r
000
defined $ds and $ds
!ll&&!rl&&r
000
MC/DC0%0/4
defined $fs and $fs or defined $ds and $ds
defined $fs $fs defined $ds $ds
Truth table0%0/7
A and B or C and D
A= defined $fsB= $fsC= defined $dsD= $ds
ABCDresult
11XX1
0X111
10111
0X0X0
0X100
100X0
10100
196  
197 0 my $r;
198  
199 0 ▶ if (defined($ds) && $ds) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $ds and $ds) 0 0 0
Condition0%0/3
defined $ds and $ds
!ll&&!rl&&r
000
MC/DC0%0/2
defined $ds and $ds
defined $ds $ds
Truth table0%0/3
A and B
A= defined $dsB= $ds
ABresult
0X0
100
111
200 0 my $rd;
201 0 $rd->{applicantdataset} = $ds;
202 0 $r = applicant_dataset($epp, 'update', $rd);
203 }
204  
205 0 ▶ if ($fs) {
Branch: 1 branch
BranchTrueFalseTotal
if ($fs) 0 0 0
206 0 my $rd;
207 0 $rd->{facets} = $fs;
208 0 $r = facet($epp, $domain, $rd);
209 }
210 0 return $r;
211 }
212  
213  
214 0 ▶sub delete { ## no critic (Subroutines::ProhibitBuiltinHomonyms)
Subroutine delete: not called CC=25 SCAR=64.8
Pod undocumented
215 0 my ( $epp, $domain, $rd ) = @_;
216 0 my $mes = $epp->message();
217  
218 0 my $ddate = $rd->{deleteDate};
219 0 my $dfd = $rd->{deletefromdns};
220 0 my $dfr = $rd->{deletefromregistry};
221 0 my $fs = $rd->{facets};
222  
223 0 ▶ return unless ( ( defined($ddate) || defined($dfd) || defined($dfr) || defined($fs) ) && (
Branch: 1 branch
BranchTrueFalseTotal
unless defined $ddate || defined $dfd || defined $dfr || defined $fs and $ddate || $dfd || $dfr || $fs 0 0 0
Condition0%0/21
defined $ddate || defined $dfd || defined $dfr || defined $fs and $ddate || $dfd || $dfr || $fs
!ll&&!rl&&r
000
defined $ddate or defined $dfd or defined $dfr or defined $fs
l!l&&r!l&&!r
000
defined $ddate or defined $dfd or defined $dfr
l!l&&r!l&&!r
000
defined $ddate or defined $dfd
l!l&&r!l&&!r
000
$ddate or $dfd or $dfr or $fs
l!l&&r!l&&!r
000
$ddate or $dfd or $dfr
l!l&&r!l&&!r
000
$ddate or $dfd
l!l&&r!l&&!r
000
MC/DC0%0/8
defined $ddate || defined $dfd || defined $dfr || defined $fs and $ddate || $dfd || $dfr || $fs
defined $ddate defined $dfd defined $dfr defined $fs $ddate $dfd $dfr $fs
Truth table0%0/21
A or B or C or D and E or F or G or H
A= defined $ddateB= defined $dfdC= defined $dfrD= defined $fsE= $ddateF= $dfdG= $dfrH= $fs
ABCDEFGHresult
0000XXXX0
1XXX00000
01XX00000
001X00000
000100000
1XXX1XXX1
1XXX01XX1
1XXX001X1
1XXX00011
01XX1XXX1
01XX01XX1
01XX001X1
01XX00011
001X1XXX1
001X01XX1
001X001X1
001X00011
00011XXX1
000101XX1
0001001X1
000100011
224 $ddate || $dfd || $dfr || $fs ) );
225  
226 0 ▶ if (defined($dfd) && ref($dfd)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $dfd and ref $dfd) 0 0 0
Condition0%0/3
defined $dfd and ref $dfd
!ll&&!rl&&r
000
MC/DC0%0/2
defined $dfd and ref $dfd
defined $dfd ref $dfd
Truth table0%0/3
A and B
A= defined $dfdB= ref $dfd
ABresult
0X0
100
111
227 0 Net::DRI::Util::check_isa($dfd,'DateTime');
228 0 $dfd = $dfd->set_time_zone('CET')->strftime('%Y-%m-%d');
229 }
230 0 ▶ if (defined($dfr) && ref($dfr)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $dfr and ref $dfr) 0 0 0
Condition0%0/3
defined $dfr and ref $dfr
!ll&&!rl&&r
000
MC/DC0%0/2
defined $dfr and ref $dfr
defined $dfr ref $dfr
Truth table0%0/3
A and B
A= defined $dfrB= ref $dfr
ABresult
0X0
100
111
231 0 Net::DRI::Util::check_isa($dfr,'DateTime');
232 0 $dfr = $dfr->set_time_zone('CET')->strftime('%Y-%m-%d');
233 }
234 0 ▶ if (defined($ddate)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $ddate) 0 0 0
235 0 ▶ if (ref($ddate)) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $ddate) 0 0 0
236 0 Net::DRI::Util::check_isa($ddate,'DateTime');
237 0 $ddate = $ddate->set_time_zone('CET')->strftime('%Y-%m-%d');
238 }
239 0 ▶ $dfd = $ddate if !$dfd;
Branch: 1 branch
BranchTrueFalseTotal
unless $dfd 0 0 0
240 0 ▶ $dfr = $ddate if !$dfr;
Branch: 1 branch
BranchTrueFalseTotal
unless $dfr 0 0 0
241 }
242  
243 0 my $r;
244 0 ▶ if ( $dfd || $dfr ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($dfd or $dfr) 0 0 0
Condition0%0/3
$dfd or $dfr
l!l&&r!l&&!r
000
MC/DC0%0/2
$dfd or $dfr
$dfd $dfr
Truth table0%0/3
A or B
A= $dfdB= $dfr
ABresult
1X1
011
000
245 0 my @e;
246 0 ▶ push @e, [ 'no-ext-domain:deleteFromDNS', $dfd ] if ( defined($dfd) && $dfd );
Branch: 1 branch
BranchTrueFalseTotal
if defined $dfd and $dfd 0 0 0
Condition0%0/3
defined $dfd and $dfd
!ll&&!rl&&r
000
MC/DC0%0/2
defined $dfd and $dfd
defined $dfd $dfd
Truth table0%0/3
A and B
A= defined $dfdB= $dfd
ABresult
0X0
100
111
247 0 ▶ push @e, [ 'no-ext-domain:deleteFromRegistry', $dfr ] if ( defined($dfr) && $dfr );
Branch: 1 branch
BranchTrueFalseTotal
if defined $dfr and $dfr 0 0 0
Condition0%0/3
defined $dfr and $dfr
!ll&&!rl&&r
000
MC/DC0%0/2
defined $dfr and $dfr
defined $dfr $dfr
Truth table0%0/3
A and B
A= defined $dfrB= $dfr
ABresult
0X0
100
111
248  
249 0 ▶ $r = $epp->message()->command_extension( 'no-ext-domain', [ 'delete', @e ] ) if @e;
Branch: 1 branch
BranchTrueFalseTotal
if @e 0 0 0
250 }
251 0 ▶ if ($fs) {
Branch: 1 branch
BranchTrueFalseTotal
if ($fs) 0 0 0
252 0 $r = facet($epp, $domain, $rd);
253 }
254 0 return $r;
255  
256 }
257  
258  
259 0 ▶sub transfer_request {
Subroutine transfer_request: not called CC=14 SCAR=53.5
Pod undocumented
260 0 my ( $epp, $domain, $rd ) = @_;
261  
262 0 my $mp = $rd->{mobilephone};
263 0 my $em = $rd->{email};
264 0 my $fs = $rd->{facets};
265  
266 0 ▶ return unless ( ( defined($mp) || defined($em) || defined($fs) ) && ( $mp || $em || $fs) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $mp || defined $em || defined $fs and $mp || $em || $fs 0 0 0
Condition0%0/15
defined $mp || defined $em || defined $fs and $mp || $em || $fs
!ll&&!rl&&r
000
defined $mp or defined $em or defined $fs
l!l&&r!l&&!r
000
defined $mp or defined $em
l!l&&r!l&&!r
000
$mp or $em or $fs
l!l&&r!l&&!r
000
$mp or $em
l!l&&r!l&&!r
000
MC/DC0%0/6
defined $mp || defined $em || defined $fs and $mp || $em || $fs
defined $mp defined $em defined $fs $mp $em $fs
Truth table0%0/13
A or B or C and D or E or F
A= defined $mpB= defined $emC= defined $fsD= $mpE= $emF= $fs
ABCDEFresult
000XXX0
1XX0000
01X0000
0010000
1XX1XX1
1XX01X1
1XX0011
01X1XX1
01X01X1
01X0011
0011XX1
00101X1
0010011
267  
268 0 my $r;
269 0 ▶ if ($mp || $em) {
Branch: 1 branch
BranchTrueFalseTotal
if ($mp or $em) 0 0 0
Condition0%0/3
$mp or $em
l!l&&r!l&&!r
000
MC/DC0%0/2
$mp or $em
$mp $em
Truth table0%0/3
A or B
A= $mpB= $em
ABresult
1X1
011
000
270  
271 0 my @d;
272 0 ▶ push @d,
Branch: 1 branch
BranchTrueFalseTotal
if defined $mp and $mp 0 0 0
Condition0%0/3
defined $mp and $mp
!ll&&!rl&&r
000
MC/DC0%0/2
defined $mp and $mp
defined $mp $mp
Truth table0%0/3
A and B
A= defined $mpB= $mp
ABresult
0X0
100
111
273 Net::DRI::Protocol::EPP::Util::build_tel(
274 'no-ext-domain:mobilePhone', $mp )
275 if ( defined($mp) && $mp );
276 0 ▶ push @d, [ 'no-ext-domain:email', $em ] if ( defined($em) && $em );
Branch: 1 branch
BranchTrueFalseTotal
if defined $em and $em 0 0 0
Condition0%0/3
defined $em and $em
!ll&&!rl&&r
000
MC/DC0%0/2
defined $em and $em
defined $em $em
Truth table0%0/3
A and B
A= defined $emB= $em
ABresult
0X0
100
111
277  
278 0 my @e;
279 0 push @e, [ 'no-ext-domain:notify', @d ];
280 0 $r = $epp->message()->command_extension( 'no-ext-domain', [ 'transfer', @e ] );
281  
282 }
283 0 ▶ if ($fs) {
Branch: 1 branch
BranchTrueFalseTotal
if ($fs) 0 0 0
284 0 $r = facet($epp, $domain, $rd);
285 }
286  
287 0 return $r;
288  
289 }
290  
291  
292 0 ▶sub withdraw {
Subroutine withdraw: not called CC=8 SCAR=42.8
Pod undocumented
293 0 my ( $epp, $domain, $rd ) = @_;
294 0 my $mes = $epp->message();
295  
296 0 my $transaction;
297 0 ▶ $transaction = $rd->{transactionname} if $rd->{transactionname};
Branch: 1 branch
BranchTrueFalseTotal
if $rd->{"transactionname"} 0 0 0
298  
299 0 my $fs = $rd->{facets};
300  
301 0 ▶ return unless ( $transaction && $transaction eq 'withdraw');
Branch: 1 branch
BranchTrueFalseTotal
unless $transaction and $transaction eq "withdraw" 0 0 0
Condition0%0/3
$transaction and $transaction eq "withdraw"
!ll&&!rl&&r
000
MC/DC0%0/2
$transaction and $transaction eq "withdraw"
$transaction $transaction eq "withdraw"
Truth table0%0/3
A and B
A= $transactionB= $transaction eq "withdraw"
ABresult
0X0
100
111
302  
303 0 ▶ Net::DRI::Exception::usererr_insufficient_parameters(
Branch: 1 branch
BranchTrueFalseTotal
unless defined $domain and $domain 0 0 0
Condition0%0/3
defined $domain and $domain
!ll&&!rl&&r
000
MC/DC0%0/2
defined $domain and $domain
defined $domain $domain
Truth table0%0/3
A and B
A= defined $domainB= $domain
ABresult
0X0
100
111
304 'Witdraw command requires a domain name')
305 unless ( defined($domain) && $domain );
306  
307 0 my $r;
308  
309 0 $r=$mes->command_extension(
310 'no-ext-epp',
311 [ 'command',
312 [ 'no-ext-epp:withdraw',
313 [ 'domain:withdraw', [ 'domain:name', $domain ],
314 {'xmlns:domain' => $mes->nsattrs('no-ext-domain')}
315 ]
316 ],
317 [ 'no-ext-epp:clTRID', $mes->cltrid() ]
318 ]
319 );
320  
321 0 ▶ if ( defined($fs) && $fs ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $fs and $fs) 0 0 0
Condition0%0/3
defined $fs and $fs
!ll&&!rl&&r
000
MC/DC0%0/2
defined $fs and $fs
defined $fs $fs
Truth table0%0/3
A and B
A= defined $fsB= $fs
ABresult
0X0
100
111
322 0 $r = facet($epp, $domain, $rd);
323 }
324  
325 0 return $r;
326  
327 }
328  
329 0 ▶sub transfer_execute {
Subroutine transfer_execute: not called CC=17 SCAR=57.2
Pod undocumented
330 0 my ( $epp, $domain, $rd ) = @_;
331 0 my $mes = $epp->message();
332  
333 0 my $transaction;
334 0 ▶ $transaction = $rd->{transactionname} if $rd->{transactionname};
Branch: 1 branch
BranchTrueFalseTotal
if $rd->{"transactionname"} 0 0 0
335  
336 0 ▶ return unless ( $transaction && $transaction eq 'transfer_execute' );
Branch: 1 branch
BranchTrueFalseTotal
unless $transaction and $transaction eq "transfer_execute" 0 0 0
Condition0%0/3
$transaction and $transaction eq "transfer_execute"
!ll&&!rl&&r
000
MC/DC0%0/2
$transaction and $transaction eq "transfer_execute"
$transaction $transaction eq "transfer_execute"
Truth table0%0/3
A and B
A= $transactionB= $transaction eq "transfer_execute"
ABresult
0X0
100
111
337  
338 0 my ( $auth, $du, $token, $fs );
339 0 ▶ $auth = $rd->{auth} if Net::DRI::Util::has_key($rd,'auth');
Branch: 1 branch
BranchTrueFalseTotal
if Net::DRI::Util::has_key($rd, "auth") 0 0 0
340 0 ▶ $du = $rd->{duration} if Net::DRI::Util::has_key($rd,'duration');
Branch: 1 branch
BranchTrueFalseTotal
if Net::DRI::Util::has_key($rd, "duration") 0 0 0
341 0 ▶ $token = $rd->{token} if Net::DRI::Util::has_key($rd,'token');
Branch: 1 branch
BranchTrueFalseTotal
if Net::DRI::Util::has_key($rd, "token") 0 0 0
342 0 ▶ $fs = $rd->{facets} if Net::DRI::Util::has_key($rd,'facets');
Branch: 1 branch
BranchTrueFalseTotal
if Net::DRI::Util::has_key($rd, "facets") 0 0 0
343  
344 # Duration is optional
345 0 my $dur;
346 0 ▶ if ( defined($du)
Branch: 1 branch
BranchTrueFalseTotal
if (defined $du and $du and Net::DRI::Util::has_duration($rd)) 0 0 0
Condition0%0/6
defined $du and $du and Net::DRI::Util::has_duration($rd)
!ll&&!rl&&r
000
defined $du and $du
!ll&&!rl&&r
000
MC/DC0%0/3
defined $du and $du and Net::DRI::Util::has_duration($rd)
defined $du $du Net::DRI::Util::has_duration($rd)
Truth table0%0/4
A and B and C
A= defined $duB= $duC= Net::DRI::Util::has_duration($rd)
ABCresult
0XX0
10X0
1100
1111
347 && $du
348 && Net::DRI::Util::has_duration( $rd )
349 )
350 {
351 0 Net::DRI::Util::check_isa( $du, 'DateTime::Duration' );
352  
353 0 ▶ Net::DRI::Exception->die( 0, 'DRD::NO', 3, 'Invalid duration' )
Branch: 1 branch
BranchTrueFalseTotal
if "Net::DRI::DRD::NORID"->verify_duration_renew(undef, $du, $domain) 0 0 0
354 if Net::DRI::DRD::NORID->verify_duration_renew(undef, $du, $domain ); ## TODO: this test should be done in Net::DRI::DRD::NORID directly !
355 0 $dur = Net::DRI::Protocol::EPP::Util::build_period($du);
356 }
357  
358 0 my $cltrid=$mes->cltrid();
359  
360 0 my %domns = ('xmlns:domain' => 'urn:ietf:params:xml:ns:domain-1.0');
361  
362 0 my $r;
363  
364 0 ▶ if ( Net::DRI::Util::has_auth( $rd )
Branch: 2 branches
BranchTrueFalseTotal
if (Net::DRI::Util::has_auth($rd) and ref $rd->{'auth'} eq 'HASH') { } 0 0 0
elsif ($token) { } 0 0 0
Condition0%0/3
Net::DRI::Util::has_auth($rd) and ref $rd->{"auth"} eq "HASH"
!ll&&!rl&&r
000
MC/DC0%0/2
Net::DRI::Util::has_auth($rd) and ref $rd->{"auth"} eq "HASH"
Net::DRI::Util::has_auth($rd) ref $rd->{"auth"} eq "HASH"
Truth table0%0/3
A and B
A= Net::DRI::Util::has_auth($rd)B= ref $rd->{"auth"} eq "HASH"
ABresult
0X0
100
111
365 && ( ref( $rd->{auth} ) eq 'HASH' ) )
366 {
367 $r=$mes->command_extension(
368 'no-ext-epp',
369 [ 'command',
370 [ 'no-ext-epp:transfer',
371 { 'op' => 'execute' },
372 [ 'domain:transfer',
373 \%domns,
374 [ 'domain:name', $domain ],
375 $dur,
376 Net::DRI::Protocol::EPP::Util::domain_build_authinfo(
377 $epp, $rd->{auth}
378 0 ),
379 ],
380 ],
381 [ 'no-ext-epp:clTRID', $cltrid ]
382 ]
383 );
384 } elsif ($token) {
385 0 $r=$mes->command_extension(
386 'no-ext-epp',
387 [ 'command',
388 [ 'no-ext-epp:transfer',
389 { 'op' => 'execute' },
390 [ 'domain:transfer', \%domns,
391 [ 'domain:name', $domain ], $dur,
392 ],
393 ],
394 [ 'no-ext-epp:extension',
395 [ 'no-ext-domain:transfer', {'xmlns:no-ext-domain' => $mes->nsattrs('no-ext-domain')},
396 [ 'no-ext-domain:token', $token ]
397 ]
398 ],
399 [ 'no-ext-epp:clTRID', $cltrid ]
400 ]
401 );
402 } else {
403 0 $r=$mes->command_extension(
404 'no-ext-epp',
405 [ 'command',
406 [ 'no-ext-epp:transfer',
407 { 'op' => 'execute' },
408 [ 'domain:transfer', \%domns,
409 [ 'domain:name', $domain ], $dur,
410 ],
411 ],
412 [ 'no-ext-epp:clTRID', $cltrid ]
413 ]
414 );
415 }
416  
417 0 ▶ if ( defined($fs) && $fs ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $fs and $fs) 0 0 0
Condition0%0/3
defined $fs and $fs
!ll&&!rl&&r
000
MC/DC0%0/2
defined $fs and $fs
defined $fs $fs
Truth table0%0/3
A and B
A= defined $fsB= $fs
ABresult
0X0
100
111
418 0 $r = facet($epp, $domain, $rd);
419 }
420  
421 0 return $r;
422  
423 }
424  
425 ####################################################################################################
426 1 1;
« DRI/Protocol/RRI/Contact.pm ↑ Summary DRI/Protocol/EPP/Extensions/CoCCA/IPVerification.pm »