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

filter: Statementstmt 26.3% 10 / 38 Branchbran 0.0% 0 / 14 Conditioncond 0.0% 0 / 18 MC/DCmcdc 0.0% 0 / 8 Subroutinesub 50.0% 3 / 6 Podpod 0.0% 0 / 3 totaltotal 14.9% 13 / 87 CC 14 SCAR 39.4
CC
14
Cov
14%
info_parse
72.0
create
56.0
register_commands
2.0
CRAP 51.2
« DRI/Protocol/IRIS/LWZ.pm ↑ Summary DRI/Protocol/EPP/Extensions/CentralNic/Release.pm »
1 ## Domain Registry Interface, .AERO Domain EPP extension commands
2 ##
3 ## Copyright (c) 2006-2008,2013,2016 Patrick Mevzek <netdri@dotandco.com>. 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::AERO::Domain;
16  
17 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 1 ▶use Net::DRI::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 =pod
23  
24 =head1 NAME
25  
26 Net::DRI::Protocol::EPP::Extensions::AERO::Domain - .AERO EPP Domain extension commands for Net::DRI
27  
28 =head1 DESCRIPTION
29  
30 Please see the README file for details.
31  
32 =head1 SUPPORT
33  
34 For now, support questions should be sent to:
35  
36 E<lt>netdri@dotandco.comE<gt>
37  
38 Please also see the SUPPORT file in the distribution.
39  
40 =head1 SEE ALSO
41  
42 E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
43  
44 =head1 AUTHOR
45  
46 Patrick Mevzek, E<lt>netdri@dotandco.comE<gt>
47  
48 =head1 COPYRIGHT
49  
50 Copyright (c) 2006-2008,2013,2016 Patrick Mevzek <netdri@dotandco.com>.
51 All rights reserved.
52  
53 This program is free software; you can redistribute it and/or modify
54 it under the terms of the GNU General Public License as published by
55 the Free Software Foundation; either version 2 of the License, or
56 (at your option) any later version.
57  
58 See the LICENSE file that comes with this distribution for more details.
59  
60 =cut
61  
62 ####################################################################################################
63  
64 sub register_commands
65 {
66 0 ▶ my ($class,$version)=@_;
Subroutine register_commands: not called CC=1 SCAR=6.9
Pod undocumented
67 0 my %tmp=(
68 create => [ \&create, undef ],
69 info => [ undef, \&info_parse ],
70 );
71  
72 0 return { 'domain' => \%tmp };
73 }
74  
75 ####################################################################################################
76  
77 sub create
78 {
79 0 ▶ my ($epp,$domain,$rd)=@_;
Subroutine create: not called CC=7 SCAR=40.3
Pod undocumented
80  
81 Net::DRI::Exception::usererr_insufficient_parameters('ens attribute is mandatory, as ref hash with keys auth_id and auth_key')
82 0 ▶ unless (exists($rd->{ens}) && (ref($rd->{ens}) eq 'HASH') && exists($rd->{ens}->{auth_id}) && $rd->{ens}->{auth_id} && exists($rd->{ens}->{auth_key}) && $rd->{ens}->{auth_key});
Branch: 1 branch
BranchTrueFalseTotal
unless exists $rd->{"ens"} and ref $rd->{"ens"} eq "HASH" and exists $rd->{"ens"}{"auth_id"} and $rd->{"ens"}{"auth_id"} and exists $rd->{"ens"}{"auth_key"} and $rd->{"ens"}{"auth_key"} 0 0 0
Condition0%0/15
exists $rd->{"ens"} and ref $rd->{"ens"} eq "HASH" and exists $rd->{"ens"}{"auth_id"} and $rd->{"ens"}{"auth_id"} and exists $rd->{"ens"}{"auth_key"} and $rd->{"ens"}{"auth_key"}
!ll&&!rl&&r
000
exists $rd->{"ens"} and ref $rd->{"ens"} eq "HASH" and exists $rd->{"ens"}{"auth_id"} and $rd->{"ens"}{"auth_id"} and exists $rd->{"ens"}{"auth_key"}
!ll&&!rl&&r
000
exists $rd->{"ens"} and ref $rd->{"ens"} eq "HASH" and exists $rd->{"ens"}{"auth_id"} and $rd->{"ens"}{"auth_id"}
!ll&&!rl&&r
000
exists $rd->{"ens"} and ref $rd->{"ens"} eq "HASH" and exists $rd->{"ens"}{"auth_id"}
!ll&&!rl&&r
000
exists $rd->{"ens"} and ref $rd->{"ens"} eq "HASH"
!ll&&!rl&&r
000
MC/DC0%0/6
exists $rd->{"ens"} and ref $rd->{"ens"} eq "HASH" and exists $rd->{"ens"}{"auth_id"} and $rd->{"ens"}{"auth_id"} and exists $rd->{"ens"}{"auth_key"} and $rd->{"ens"}{"auth_key"}
exists $rd->{"ens"} ref $rd->{"ens"} eq "HASH" exists $rd->{"ens"}{"auth_id"} $rd->{"ens"}{"auth_id"} exists $rd->{"ens"}{"auth_key"} $rd->{"ens"}{"auth_key"}
Truth table0%0/7
A and B and C and D and E and F
A= exists $rd->{"ens"}B= ref $rd->{"ens"} eq "HASH"C= exists $rd->{"ens"}{"auth_id"}D= $rd->{"ens"}{"auth_id"}E= exists $rd->{"ens"}{"auth_key"}F= $rd->{"ens"}{"auth_key"}
ABCDEFresult
0XXXXX0
10XXXX0
110XXX0
1110XX0
11110X0
1111100
1111111
83  
84 0 my @n;
85 0 push @n,['aero:ensAuthID',$rd->{ens}->{auth_id}];
86 0 push @n,['aero:ensAuthKey',$rd->{ens}->{auth_key}];
87  
88 0 my $mes=$epp->message();
89 0 my $eid=$mes->command_extension_register('aero','create');
90 0 $mes->command_extension($eid,\@n);
91 0 return;
92 }
93  
94 sub info_parse
95 {
96 0 ▶ my ($po,$otype,$oaction,$oname,$rinfo)=@_;
Subroutine info_parse: not called CC=8 SCAR=42.8
Pod undocumented
97 0 my $mes=$po->message();
98 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
99  
100 0 my $infdata=$mes->get_extension('aero','infData');
101 0 ▶ return unless $infdata;
Branch: 1 branch
BranchTrueFalseTotal
unless $infdata 0 0 0
102  
103 0 my %ens;
104 0 my $c=$infdata->getFirstChild();
105 0 ▶ while($c)
Branch: 1 branch
BranchTrueFalseTotal
if ($c) 0 0 0
106 {
107 0 ▶ next unless ($c->nodeType() == 1); ## only for element nodes
Branch: 1 branch
BranchTrueFalseTotal
unless $c->nodeType == 1 0 0 0
108 0 ▶ my $name=$c->localname() || $c->nodeName();
Condition0%0/3
$c->localname || $c->nodeName
l!l&&r!l&&!r
000
MC/DC0%0/2
$c->localname || $c->nodeName
$c->localname $c->nodeName
Truth table0%0/3
A || B
A= $c->localnameB= $c->nodeName
ABresult
1X1
011
000
109 0 ▶ next unless $name;
Branch: 1 branch
BranchTrueFalseTotal
unless $name 0 0 0
110  
111 0 ▶ if ($name eq 'ensAuthID')
Branch: 1 branch
BranchTrueFalseTotal
if ($name eq "ensAuthID") 0 0 0
112 {
113 0 $ens{auth_id}=$c->getFirstChild()->getData();
114 }
115  
116 0 } continue { $c=$c->getNextSibling(); }
117  
118 0 $rinfo->{domain}->{$oname}->{ens}=\%ens;
119 0 return;
120 }
121  
122 ####################################################################################################
123 1 1;
« DRI/Protocol/IRIS/LWZ.pm ↑ Summary DRI/Protocol/EPP/Extensions/CentralNic/Release.pm »