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

filter: Statementstmt 21.6% 16 / 74 Branchbran 0.0% 0 / 32 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 45.4% 5 / 11 Podpod 0.0% 0 / 6 totaltotal 16.4% 21 / 128 CC 18 SCAR 40.5
CC
18
Cov
15%
extonly
132.0
extonly_parse_result
20.0
delete
12.0
CRAP 57.6
« DRI/Protocol/Whois/Domain/PT.pm ↑ Summary DRI/Protocol/EPP/Extensions/Afilias/IPR.pm »
1 ## Domain Registry Interface, nic.at domain transactions extension
2 ## Contributed by Michael Braunoeder from NIC.AT <mib@nic.at>
3 ##
4 ## Copyright (c) 2006-2008,2013,2016,2018 Patrick Mevzek <netdri@dotandco.com>. All rights reserved.
5 ##
6 ## This file is part of Net::DRI
7 ##
8 ## Net::DRI is free software; you can redistribute it and/or modify
9 ## it under the terms of the GNU General Public License as published by
10 ## the Free Software Foundation; either version 2 of the License, or
11 ## (at your option) any later version.
12 ##
13 ## See the LICENSE file that comes with this distribution for more details.
14 ####################################################################################################
15  
16 package Net::DRI::Protocol::EPP::Extensions::AT::Domain;
17  
18 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶use feature 'state';
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  
25 ####################################################################################################
26  
27 sub register_commands {
28 0 ▶ my ( $class, $version ) = @_;
Subroutine register_commands: not called CC=1 SCAR=6.9
Pod undocumented
29 0 state $rops = { domain => { nocommand => [ \&extonly, \&extonly_parse_result ],
30 delete => [ \&delete, undef ],
31 transfer_request => [ \&transfer_request, \&extonly_parse_result ],
32 },
33 };
34 0 return $rops;
35 }
36  
37 sub setup
38 {
39 0 ▶ my ($class,$po,$version)=@_;
Subroutine setup: not called CC=1 SCAR=6.9
Pod undocumented
40 0 state $ns = { 'at-ext-domain' => 'http://www.nic.at/xsd/at-ext-domain-1.0',
41 'at-ext-epp' => 'http://www.nic.at/xsd/at-ext-epp-1.0',
42 };
43 0 $po->ns($ns);
44 0 return;
45 }
46  
47 ####################################################################################################
48  
49 sub extonly {
50 0 ▶ my ( $epp, $domain, $rd ) = @_;
Subroutine extonly: not called CC=11 SCAR=48.8
Pod undocumented
51  
52 0 my $transaction;
53 0 ▶ $transaction = $rd->{transactionname} if $rd->{transactionname};
Branch: 1 branch
BranchTrueFalseTotal
if $rd->{"transactionname"} 0 0 0
54  
55 0 ▶ return unless ($transaction);
Branch: 1 branch
BranchTrueFalseTotal
unless $transaction 0 0 0
56  
57 0 my $mes = $epp->message();
58  
59 0 ▶ Net::DRI::Exception->die(1,'protocol/EPP',2,'Domain name needed') unless defined($domain) && $domain;
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
60 0 ▶ Net::DRI::Exception->die(1,'protocol/EPP',10,'Invalid domain name: '.$domain) unless Net::DRI::Util::is_hostname($domain);
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::is_hostname($domain) 0 0 0
61 ##$mes->command_body([['domain:name',$domain]]); ## Useless if pure extension
62  
63 0 my $eid = $mes->command_extension_register( 'at-ext-epp', 'command');
64  
65 0 my $cltrid=$mes->cltrid();
66  
67 0 ▶ if ( $transaction eq 'withdraw' ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($transaction eq 'withdraw') { } 0 0 0
elsif ($transaction eq 'transfer_execute') { } 0 0 0
68  
69 0 my %domns;
70 0 $domns{'xmlns:domain'} = $mes->ns('at-ext-domain');
71  
72 0 my %zdhash;
73 0 ▶ $zdhash{'value'} = $rd->{zd} ? $rd->{zd} : 0;
Branch: 1 branch
BranchTrueFalseTotal
$rd->{'zd'} ? : 0 0 0
74  
75 0 $mes->command_extension(
76 $eid,
77  
78 [
79 ['withdraw',
80 [ 'domain:withdraw', ['domain:name', $domain], \%domns ,
81 ['domain:zd', \%zdhash], \%domns ]],
82 ['clTRID', $cltrid ]
83  
84 ]
85 );
86  
87  
88 }
89 elsif ( $transaction eq 'transfer_execute' ) {
90  
91  
92 0 my $token;
93 0 ▶ $token = $rd->{token} if $rd->{token};
Branch: 1 branch
BranchTrueFalseTotal
if $rd->{"token"} 0 0 0
94  
95 0 ▶ return unless ( defined($token) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $token 0 0 0
96  
97 0 my %domns;
98 0 $domns{'xmlns:domain'} = $mes->ns('domain');
99  
100 0 my %domns2;
101 0 $domns2{'xmlns:at-ext-domain'} = $mes->ns('at-ext-domain');
102  
103  
104  
105 0 $mes->command_extension(
106 $eid,
107 [
108 ['transfer',
109  
110 { 'op' => 'execute' },
111 [ 'domain:transfer', \%domns, [ 'domain:name', $domain ]
112 ]
113 ],
114 ['extension',
115 ['at-ext-domain:transfer' , \%domns2, ['at-ext-domain:token',$token]
116 ]
117 ],
118 ['clTRID', $cltrid]
119 ]
120 );
121  
122 }
123 0 return;
124 }
125  
126 sub delete { ## no critic (Subroutines::ProhibitBuiltinHomonyms)
127  
128 0 ▶ my ( $epp, $domain, $rd ) = @_;
Subroutine delete: not called CC=3 SCAR=24.8
Pod undocumented
129 0 my $mes = $epp->message();
130  
131 0 my $scheduledate;
132 0 ▶ $scheduledate = $rd->{scheduledate} if $rd->{scheduledate};
Branch: 1 branch
BranchTrueFalseTotal
if $rd->{"scheduledate"} 0 0 0
133  
134 0 ▶ return unless ( defined($scheduledate) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $scheduledate 0 0 0
135  
136 0 my $eid = $mes->command_extension_register( 'at-ext-domain', 'delete');
137  
138 0 $mes->command_extension( $eid,
139 [ 'at-ext-domain:scheduledate', $scheduledate ] );
140 0 return;
141 }
142  
143 sub transfer_request {
144 0 ▶ my ( $epp, $domain, $rd ) = @_;
Subroutine transfer_request: not called CC=3 SCAR=24.8
Pod undocumented
145 0 my $mes = $epp->message();
146  
147 0 my $registrarinfo;
148 0 ▶ $registrarinfo = $rd->{registrarinfo} if $rd->{registrarinfo};
Branch: 1 branch
BranchTrueFalseTotal
if $rd->{"registrarinfo"} 0 0 0
149  
150 0 ▶ return unless ( defined($registrarinfo) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $registrarinfo 0 0 0
151  
152 0 my $eid = $mes->command_extension_register( 'at-ext-domain', 'clientdata');
153  
154 0 my %entryname;
155 0 $entryname{name} = 'Registrarinfo';
156 0 $mes->command_extension( $eid,
157 [ 'at-ext-domain:entry', \%entryname, $registrarinfo ] );
158 0 return;
159 }
160  
161 sub extonly_parse_result {
162 0 ▶ my ($po,$otype,$oaction,$oname,$rinfo)=@_;
Subroutine extonly_parse_result: not called CC=4 SCAR=30.0
Pod undocumented
163 0 my $mes=$po->message();
164 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
165  
166 0 my $keydatedata=$mes->get_extension('at-ext-domain', 'keydate');
167 0 ▶ return unless defined $keydatedata;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $keydatedata 0 0 0
168  
169 0 my $keydate = $keydatedata->textContent();
170 0 ▶ return unless defined $keydate;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $keydate 0 0 0
171  
172 0 $rinfo->{domain}->{$oname}->{keydate}=$keydate;
173  
174 0 return;
175 }
176  
177  
178  
179 ####################################################################################################
180 1 1;
181  
182 __END__
183  
184 =pod
185  
186 =head1 NAME
187  
188 Net::DRI::Protocol::EPP::Extensions::AT::Domain - NIC.AT EPP Domain extension for Net::DRI
189  
190 =head1 DESCRIPTION
191  
192 Please see the README file for details.
193  
194 =head1 SUPPORT
195  
196 For now, support questions should be sent to:
197  
198 E<lt>netdri@dotandco.comE<gt>
199  
200 Please also see the SUPPORT file in the distribution.
201  
202 =head1 SEE ALSO
203  
204 E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
205  
206 =head1 AUTHOR
207  
208 Patrick Mevzek, E<lt>netdri@dotandco.comE<gt>
209  
210 =head1 COPYRIGHT
211  
212 Copyright (c) 2006-2008,2013,2016,2018 Patrick Mevzek <netdri@dotandco.com>.
213 All rights reserved.
214  
215 This program is free software; you can redistribute it and/or modify
216 it under the terms of the GNU General Public License as published by
217 the Free Software Foundation; either version 2 of the License, or
218 (at your option) any later version.
219  
220 See the LICENSE file that comes with this distribution for more details.
221  
222 =cut
« DRI/Protocol/Whois/Domain/PT.pm ↑ Summary DRI/Protocol/EPP/Extensions/Afilias/IPR.pm »