EPP/CoCCA.pm

filter: Statementstmt 28.0% 14 / 50 Branchbran 0.0% 0 / 12 Conditioncond 0.0% 0 / 17 MC/DCmcdc 0.0% 0 / 10 Subroutinesub 44.4% 4 / 9 Podpod 100% 5 / 5 totaltotal 22.3% 23 / 103 SCAR 48.1
CC
14
Cov
18%
make_request
132.0
confirmations_restore_domain
12.0
create_domain
6.0
CRAP 123.2
« EPP/Afilias.pm ↑ Summary EPP/Test/Server.pm »
1 package IO::EPP::CoCCA;
2  
3 =encoding utf8
4  
5 =head1 NAME
6  
7 IO::EPP::CoCCA
8  
9 =head1 SYNOPSIS
10  
11 use IO::EPP::CoCCA;
12  
13 # Parameters for IO::Socket::SSL
14 my %sock_params = (
15 PeerHost => 'registry.rusnames.net',
16 PeerPort => 700,
17 # without certificate
18 Timeout => 30,
19 );
20  
21 # Create object, get greeting and call login()
22 my $conn = IO::EPP::CoCCA->new( {
23 user => 'login',
24 pass => 'xxxx',
25 sock_params => \%sock_params,
26 test_mode => 0, # real connect
27 } );
28  
29 # Check domain
30 my ( $answ, $code, $msg ) = $conn->check_domains( { domains => [ 'xn--d1acufc.xn--p1acf' ] } );
31  
32 # Call logout() and destroy object
33 undef $conn;
34  
35 =head1 DESCRIPTION
36  
37 Module for work with .РУС/.xn--p1acf, .CX, ... tlds. All list see on https://cocca.org.nz/#five
38  
39 Frontends:
40 https://rusnames.com/
41 https://cocca.org.nz/
42  
43 Backend:
44 https://secure.coccaregistry.net/
45  
46 CoCCA features:
47  
48 - not show authinfo in domain:info
49  
50 =cut
51  
52 1 ▶use IO::EPP::Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
53 1 ▶use parent qw( IO::EPP::Base );
Subroutine BEGIN: called CC=1 SCAR=0.0
54  
55 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
56 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
57  
58  
59 1 my $rgp_ext = 'xmlns:rgp="urn:ietf:params:xml:ns:rgp-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:ietf:params:xml:ns:rgp-1.0 rgp-1.0.xsd"';
60  
61  
62 sub make_request {
63 0 ▶ my ( $action, $params ) = @_;
Subroutine make_request: not called CC=11 SCAR=48.8
Pod documented
64  
65 0 my ( $self, $code, $msg, $answ );
66  
67 0 ▶ unless ( $params->{conn} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($params->{'conn'}) { } 0 0 0
68 0 ▶ $params->{sock_params}{PeerHost} ||= 'registry.rusnames.net'; # .РУС / .xn--p1acf
Condition0%0/2
$params->{"sock_params"}{"PeerHost"} ||= "registry.rusnames.net"
l!l
00
MC/DC0%0/1
$params->{"sock_params"}{"PeerHost"} ||= "registry.rusnames.net"
$params->{"sock_params"}{"PeerHost"}
Truth table0%0/2
A
A= $params->{"sock_params"}{"PeerHost"}
Aresult
11
00
69 0 ▶ $params->{sock_params}{PeerPort} ||= 700;
Condition0%0/2
$params->{"sock_params"}{"PeerPort"} ||= 700
l!l
00
MC/DC0%0/1
$params->{"sock_params"}{"PeerPort"} ||= 700
$params->{"sock_params"}{"PeerPort"}
Truth table0%0/2
A
A= $params->{"sock_params"}{"PeerPort"}
Aresult
11
00
70  
71 0 ( $self, $code, $msg ) = __PACKAGE__->new( $params );
72  
73 0 ▶ unless ( $code and $code == 1000 ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($code and $code == 1000) 0 0 0
Condition0%0/3
$code and $code == 1000
!ll&&!rl&&r
000
MC/DC0%0/2
$code and $code == 1000
$code $code == 1000
Truth table0%0/3
A and B
A= $codeB= $code == 1000
ABresult
0X0
100
111
74 0 goto END_MR;
75 }
76 }
77 else {
78 0 $self = $params->{conn};
79 }
80  
81  
82 0 $self->{critical_error} = '';
83  
84 0 ▶ if ( $self->can( $action ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->can($action)) { } 0 0 0
85 0 ( $answ, $code, $msg ) = $self->$action( $params );
86 }
87 else {
88 0 $msg = "undefined command <$action>, request cancelled";
89 0 $code = 0;
90 }
91  
92  
93 END_MR:
94  
95 0 ▶ $msg .= '; ' . $self->{critical_error} if $self->{critical_error};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"critical_error"} 0 0 0
96  
97 0 my $full_answ = "code: $code\nmsg: $msg";
98  
99 0 ▶ $answ = {} unless $answ && ref $answ;
Branch: 1 branch
BranchTrueFalseTotal
unless $answ and ref $answ 0 0 0
Condition0%0/3
$answ and ref $answ
!ll&&!rl&&r
000
MC/DC0%0/2
$answ and ref $answ
$answ ref $answ
Truth table0%0/3
A and B
A= $answB= ref $answ
ABresult
0X0
100
111
100  
101 0 $answ->{code} = $code;
102 0 $answ->{msg} = $msg;
103  
104 0 ▶ return wantarray ? ( $answ, $full_answ, $self ) : $answ;
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 0 0
105 }
106  
107 =head1 METHODS
108  
109 Next, those functions are redefined in which the provider has additions to the EPP
110  
111 =head2 login
112  
113 Ext params for login,
114  
115 INPUT: new password for change
116  
117 =cut
118  
119 sub login {
120 0 ▶ my ( $self, $pw ) = @_;
Subroutine login: not called CC=1 SCAR=6.9
Pod documented
121  
122 0 my $svcs = '
123 <objURI>urn:ietf:params:xml:ns:contact-1.0</objURI>
124 <objURI>urn:ietf:params:xml:ns:domain-1.0</objURI>
125 <objURI>urn:ietf:params:xml:ns:host-1.0</objURI>';
126 0 my $extension = '
127 <extURI>urn:ietf:params:xml:ns:rgp-1.0</extURI>
128 <extURI>https://production.coccaregistry.net/cocca-ip-verification-1.1</extURI>
129 <extURI>https://production.coccaregistry.net/cocca-contact-proxy-1.0</extURI>
130 <extURI>https://production.coccaregistry.net/cocca-contact-proxy-create-update-1.0</extURI>
131 <extURI>https://production.coccaregistry.net/cocca-reseller-1.0</extURI>
132 <extURI>urn:ietf:params:xml:ns:secDNS-1.1</extURI>
133 <extURI>urn:ietf:params:xml:ns:fee-0.8</extURI>';
134  
135 0 return $self->SUPER::login( $pw, $svcs, $extension );
136 }
137  
138  
139  
140 sub create_domain {
141 0 ▶ my ( $self, $params ) = @_;
Subroutine create_domain: not called CC=2 SCAR=17.9
Pod documented
142  
143 0 ▶ $params->{authinfo} ||= IO::EPP::Base::gen_pw();
Condition0%0/3
$params->{"authinfo"} ||= IO::EPP::Base::gen_pw()
l!l&&r!l&&!r
000
MC/DC0%0/2
$params->{"authinfo"} ||= IO::EPP::Base::gen_pw()
$params->{"authinfo"} IO::EPP::Base::gen_pw()
Truth table0%0/3
A ||= B
A= $params->{"authinfo"}B= IO::EPP::Base::gen_pw()
ABresult
1X1
011
000
144  
145 $params->{extension} =
146 ' <fee:create xmlns:fee="urn:ietf:params:xml:ns:fee-0.8" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
147 <fee:currency>RUB</fee:currency>
148 0 <fee:fee>'.$params->{price}.'</fee:fee>
149 </fee:create>';
150  
151 0 return $self->SUPER::create_domain( $params );
152 }
153  
154 =head2 restore_domain
155  
156 Domain redemption
157  
158 INPUT:
159 params key C<dname> -- name of the domain to be redeemed
160  
161 OUTPUT:
162 see L</simple_request>.
163  
164 =cut
165  
166 sub restore_domain {
167 0 ▶ my ( $self, $params ) = @_;
Subroutine restore_domain: not called CC=1 SCAR=6.9
Pod documented
168  
169 $params->{extension} =
170 0 " <rgp:update $rgp_ext>
171 <rgp:restore op=\"request\"/>
172 </rgp:update>";
173  
174 0 return $self->SUPER::update_domain( $params );
175 }
176  
177  
178 =head2 confirmations_restore_domain
179  
180 Confirmation of domain redemption
181  
182 INPUT:
183 C<pre_data> -- whois before delete, can set 'none';
184 C<post_data> -- whois on now, can set 'none';
185 C<del_time> -- date-time of domain deletion in UTC;
186 C<rest_time> -- date-time of sending the redemption request in UTC.
187  
188 Fields already filled in:
189 C<resReason> -- the reason for the redemption;
190 C<statement> -- write that this is all for the client, not for us;
191 C<other> -- can be without additions.
192  
193 =cut
194  
195 sub confirmations_restore_domain {
196 0 ▶ my ( $self, $params ) = @_;
Subroutine confirmations_restore_domain: not called CC=3 SCAR=24.8
Pod documented
197  
198 0 ▶ $params->{pre_data} ||= 'none';
Condition0%0/2
$params->{"pre_data"} ||= "none"
l!l
00
MC/DC0%0/1
$params->{"pre_data"} ||= "none"
$params->{"pre_data"}
Truth table0%0/2
A
A= $params->{"pre_data"}
Aresult
11
00
199 0 ▶ $params->{post_data} ||= 'none';
Condition0%0/2
$params->{"post_data"} ||= "none"
l!l
00
MC/DC0%0/1
$params->{"post_data"} ||= "none"
$params->{"post_data"}
Truth table0%0/2
A
A= $params->{"post_data"}
Aresult
11
00
200  
201 0 $params->{extension} = <<RGPEXT;
202 <rgp:update xmlns:rgp="urn:ietf:params:xml:ns:rgp-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:ietf:params:xml:ns:rgp-1.0 rgp-1.0.xsd">
203 <rgp:restore op="report">
204 <rgp:report>
205 <rgp:preData>$$params{pre_data}</rgp:preData>
206 <rgp:postData>$$params{post_data}</rgp:postData>
207 <rgp:delTime>$$params{del_time}</rgp:delTime>
208 <rgp:resTime>$$params{rest_time}</rgp:resTime>
209 <rgp:resReason>Customer forgot to renew.</rgp:resReason>
210 <rgp:statement>I agree that the Domain Name has not been restored in order to assume the rights to use or sell the name to myself or for any third party.</rgp:statement>
211 <rgp:statement>I agree that the information provided in this Restore Report is true to the best of my knowledge, and acknowledge that intentionally supplying false information in the Restore Report shall constitute an incurable material breach of the Registry-Registrar Agreement.</rgp:statement>
212 <rgp:other/>
213 </rgp:report>
214 </rgp:restore>
215 </rgp:update>
216 RGPEXT
217  
218 0 return $self->SUPER::update_domain( $params );
219 }
220  
221  
222 1 1;
223  
224 __END__
« EPP/Afilias.pm ↑ Summary EPP/Test/Server.pm »