| 1 | package IO::EPP::Flexireg; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | =encoding utf8 | ||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | =head1 NAME | ||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | IO::EPP::Flexireg | ||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | use IO::EPP::Flexireg; | ||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | # Parameters for IO::Socket::SSL | ||||||||||||||||||||||||||||
| 14 | my %sock_params = ( | ||||||||||||||||||||||||||||
| 15 | PeerHost => 'epp.flexireg.net', | ||||||||||||||||||||||||||||
| 16 | PeerPort => 700, | ||||||||||||||||||||||||||||
| 17 | Timeout => 30, | ||||||||||||||||||||||||||||
| 18 | ); | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | # Create object, get greeting and call login() | ||||||||||||||||||||||||||||
| 21 | my $conn = IO::EPP::Flexireg->new( { | ||||||||||||||||||||||||||||
| 22 | user => 'login-msk-fir', | ||||||||||||||||||||||||||||
| 23 | pass => 'xxxxxxxx', | ||||||||||||||||||||||||||||
| 24 | sock_params => \%sock_params, | ||||||||||||||||||||||||||||
| 25 | test_mode => 0, # real connect | ||||||||||||||||||||||||||||
| 26 | } ); | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | # Check domain | ||||||||||||||||||||||||||||
| 29 | my ( $answ, $code, $msg ) = $conn->check_domains( { domains => [ 'my.moscow', 'xn--l1ae5c.xn--80adxhks' ] } ); | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | # Call logout() and destroy object | ||||||||||||||||||||||||||||
| 32 | undef $conn; | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | Module work with Flexireg tlds: .moscow, .москва, ru.net and 3lvl.ru/su | ||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | Frontend: | ||||||||||||||||||||||||||||
| 39 | https://faitid.org/ | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | Backend: | ||||||||||||||||||||||||||||
| 42 | http://flexireg.net/ | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | Documentaion: | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | moscow, москва | ||||||||||||||||||||||||||||
| 48 | L<https://faitid.org/projects/moscow/documents>, | ||||||||||||||||||||||||||||
| 49 | L<https://faitid.org/sites/default/files/policy/tech/Tu-flexireg-EPP_1.2_ru.pdf>, | ||||||||||||||||||||||||||||
| 50 | L<https://faitid.org/sites/default/files/Tu-flexireg-Examples_1.3_ru.pdf> | ||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | ru.net+ | ||||||||||||||||||||||||||||
| 53 | L<https://faitid.org/projects/RU.NET/documents>, | ||||||||||||||||||||||||||||
| 54 | L<https://faitid.org/sites/default/files/Tu-flexireg-EPP_ext.pdf> | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | =cut | ||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | 1 | ▶ | use IO::EPP::Base; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 60 | 1 | ▶ | use parent qw( IO::EPP::Base ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 63 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | 1 | my $cont_ext = | |||||||||||||||||||||||||||
| 66 | 'xmlns:contact="http://www.tcinet.ru/epp/tci-contact-ext-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.tcinet.ru/epp/tci-contact-ext-1.0 tci-contact-ext-1.0.xsd"'; | ||||||||||||||||||||||||||||
| 67 | 1 | my $rgp_ext = | |||||||||||||||||||||||||||
| 68 | '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"'; | ||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | sub make_request { | ||||||||||||||||||||||||||||
| 71 | 0 | ▶ | my ( $action, $params ) = @_; | ||||||||||||||||||||||||||
|
Subroutine
make_request: not called CC=11 SCAR=48.8
Pod
documented
| |||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | 0 | my ( $self, $code, $msg, $answ ); | |||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | 0 | ▶ | unless ( $params->{conn} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 76 | 0 | ▶ | $params->{sock_params}{PeerHost} ||= 'epp.flexireg.net'; | ||||||||||||||||||||||||||
|
Condition0%0/2
$params->{"sock_params"}{"PeerHost"} ||= "epp.flexireg.net"
MC/DC0%0/1
$params->{"sock_params"}{"PeerHost"} ||= "epp.flexireg.net"
$params->{"sock_params"}{"PeerHost"}
Truth table0%0/2
A
A= $params->{"sock_params"}{"PeerHost"}
| |||||||||||||||||||||||||||||
| 77 | 0 | ▶ | $params->{sock_params}{PeerPort} ||= 700; | ||||||||||||||||||||||||||
|
Condition0%0/2
$params->{"sock_params"}{"PeerPort"} ||= 700
MC/DC0%0/1
$params->{"sock_params"}{"PeerPort"} ||= 700
$params->{"sock_params"}{"PeerPort"}
Truth table0%0/2
A
A= $params->{"sock_params"}{"PeerPort"}
| |||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | 0 | ( $self, $code, $msg ) = __PACKAGE__->new( $params ); | |||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||
| 81 | 0 | ▶ | unless ( $code and $code == 1000 ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$code and $code == 1000
MC/DC0%0/2
$code and $code == 1000
$code
$code == 1000
Truth table0%0/3
A and B
A= $codeB= $code == 1000
| |||||||||||||||||||||||||||||
| 82 | 0 | goto END_MR; | |||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||||||||
| 85 | else { | ||||||||||||||||||||||||||||
| 86 | 0 | $self = $params->{conn}; | |||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | 0 | $self->{critical_error} = ''; | |||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | 0 | ▶ | if ( $self->can( $action ) ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 93 | 0 | ( $answ, $code, $msg ) = $self->$action( $params ); | |||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||
| 95 | else { | ||||||||||||||||||||||||||||
| 96 | 0 | $msg = "undefined command <$action>, request cancelled"; | |||||||||||||||||||||||||||
| 97 | 0 | $code = 0; | |||||||||||||||||||||||||||
| 98 | } | ||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||
| 101 | END_MR: | ||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||
| 103 | 0 | ▶ | $msg .= '; ' . $self->{critical_error} if $self->{critical_error}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||
| 105 | 0 | my $full_answ = "code: $code\nmsg: $msg"; | |||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||
| 107 | 0 | ▶ | $answ = {} unless $answ && ref $answ; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$answ and ref $answ
MC/DC0%0/2
$answ and ref $answ
$answ
ref $answ
Truth table0%0/3
A and B
A= $answB= ref $answ
| |||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||
| 109 | 0 | $answ->{code} = $code; | |||||||||||||||||||||||||||
| 110 | 0 | $answ->{msg} = $msg; | |||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||
| 112 | 0 | ▶ | return wantarray ? ( $answ, $full_answ, $self ) : $answ; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||
| 115 | =head1 METHODS | ||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||
| 117 | Further overlap functions where the provider has features | ||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||
| 119 | =head2 login | ||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||
| 121 | Ext params for login, | ||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||
| 123 | INPUT: new password for change | ||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||
| 125 | =cut | ||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||
| 127 | sub login { | ||||||||||||||||||||||||||||
| 128 | 0 | ▶ | my ( $self, $pw ) = @_; | ||||||||||||||||||||||||||
|
Subroutine
login: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||
| 130 | 0 | my $svcs = ' | |||||||||||||||||||||||||||
| 131 | <objURI>urn:ietf:params:xml:ns:contact-1.0</objURI> | ||||||||||||||||||||||||||||
| 132 | <objURI>urn:ietf:params:xml:ns:domain-1.0</objURI> | ||||||||||||||||||||||||||||
| 133 | <objURI>urn:ietf:params:xml:ns:host-1.0</objURI>'; | ||||||||||||||||||||||||||||
| 134 | 0 | my $extension = ' | |||||||||||||||||||||||||||
| 135 | <extURI>http://www.tcinet.ru/epp/tci-contact-ext-1.0</extURI> | ||||||||||||||||||||||||||||
| 136 | <extURI>urn:ietf:params:xml:ns:fee-0.11</extURI> | ||||||||||||||||||||||||||||
| 137 | <extURI>urn:ietf:params:xml:ns:idn-1.0</extURI> | ||||||||||||||||||||||||||||
| 138 | <extURI>urn:ietf:params:xml:ns:launch-1.0</extURI> | ||||||||||||||||||||||||||||
| 139 | <extURI>urn:ietf:params:xml:ns:rgp-1.0</extURI> | ||||||||||||||||||||||||||||
| 140 | <extURI>urn:ietf:params:xml:ns:secDNS-1.1</extURI>'; | ||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||
| 142 | 0 | return $self->SUPER::login( $pw, $svcs, $extension ); | |||||||||||||||||||||||||||
| 143 | } | ||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||
| 145 | sub contact_ext { | ||||||||||||||||||||||||||||
| 146 | 0 | ▶ | my ( undef, $params ) = @_; | ||||||||||||||||||||||||||
|
Subroutine
contact_ext: not called CC=10 SCAR=47.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||
| 148 | 0 | my $ext = ''; | |||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||
| 150 | 0 | ▶ | if ( $params->{birthday} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 151 | 0 | $ext .= "<contact:person>\n"; | |||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||
| 153 | 0 | foreach my $f ( 'birthday', 'passport', 'TIN' ) { | |||||||||||||||||||||||||||
| 154 | 0 | ▶ | $ext .= " <contact:$f>$$params{$f}</contact:$f>\n" if $$params{$f}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 155 | } | ||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||
| 157 | 0 | $ext .= " </contact:person>"; | |||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||
| 160 | 0 | ▶ | if ( $params->{legal} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 161 | 0 | $ext .= " <contact:organization>\n"; | |||||||||||||||||||||||||||
| 162 | 0 | foreach my $type ( 'int', 'loc' ) { | |||||||||||||||||||||||||||
| 163 | 0 | $ext .= qq| <contact:legalAddr type="$type">\n|; | |||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||
| 165 | 0 | ▶ | $$params{legal}{$type}{addr} = [ $$params{legal}{$type}{addr} ] unless ref $$params{legal}{$type}{addr}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||
| 167 | 0 | foreach my $s ( @{$$params{legal}{$type}{addr}} ) { | |||||||||||||||||||||||||||
| 168 | 0 | $ext .= " <contact:street>$s</contact:street>\n"; | |||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||
| 171 | 0 | $ext .= " <contact:city>$$params{legal}{$type}{city}</contact:city>\n"; | |||||||||||||||||||||||||||
| 172 | 0 | ▶ | $ext .= ( $$params{legal}{$type}{'state'} ? " <contact:sp>$$params{legal}{$type}{state}</contact:sp>\n" : " <contact:sp/>\n" ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 173 | 0 | ▶ | $ext .= ( $$params{legal}{$type}{postcode} ? " <contact:pc>$$params{legal}{$type}{postcode}</contact:pc>\n" : " <contact:pc/>\n" ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 174 | 0 | $ext .= " <contact:cc>$$params{legal}{$type}{country_code}</contact:cc>\n"; | |||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||
| 176 | 0 | $ext .= " </contact:legalAddr>\n"; | |||||||||||||||||||||||||||
| 177 | } | ||||||||||||||||||||||||||||
| 178 | 0 | $ext .= " <contact:TIN>$$params{TIN}</contact:TIN>\n"; | |||||||||||||||||||||||||||
| 179 | 0 | $ext .= " </contact:organization>"; | |||||||||||||||||||||||||||
| 180 | } | ||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||
| 182 | 0 | return $ext; | |||||||||||||||||||||||||||
| 183 | } | ||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||
| 186 | =head2 create_contact | ||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||
| 188 | For moscow/москва: | ||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||
| 190 | When registering a contact, you must specify both int type data and loc type data, and if the domain owner has passport data in Cyrillic, | ||||||||||||||||||||||||||||
| 191 | then loc type data must be entered in Cyrillic. | ||||||||||||||||||||||||||||
| 192 | This is mandatory for citizens and legal entities of Russia, Ukraine, Belarus and other countries that have the Cyrillic alphabet. | ||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||
| 194 | In addition, the owner must provide additional information. | ||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||
| 196 | For individuals: | ||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||
| 198 | C<birthday> -- date of birth; | ||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||
| 200 | C<passport> -- passport series and number, by whom and when it was issued; | ||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||
| 202 | C<TIN> -- TIN for individual entrepreneurs. | ||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||
| 204 | For legal entities: | ||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||
| 206 | hashref C<legal>, that contains the legal address, it also needs to specify two types: C<int> and C<loc>, consisting of the fields C<addr>, C<city>, C<state>, C<postcode>, C<country_code>. | ||||||||||||||||||||||||||||
| 207 | |||||||||||||||||||||||||||||
| 208 | You also need to specify the C<TIN> field. | ||||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||||
| 210 | An Example: | ||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||
| 212 | Individuals: | ||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||
| 214 | my %cont = ( | ||||||||||||||||||||||||||||
| 215 | int => { | ||||||||||||||||||||||||||||
| 216 | first_name => 'Igor', | ||||||||||||||||||||||||||||
| 217 | patronymic => 'Igorevich', | ||||||||||||||||||||||||||||
| 218 | last_name => 'Igorev', | ||||||||||||||||||||||||||||
| 219 | org => '', | ||||||||||||||||||||||||||||
| 220 | addr => 'Igoreva str, 129', | ||||||||||||||||||||||||||||
| 221 | city => 'Igorevsk', | ||||||||||||||||||||||||||||
| 222 | state => 'Ogorevskaya obl.', | ||||||||||||||||||||||||||||
| 223 | postcode => '699001', | ||||||||||||||||||||||||||||
| 224 | country_code => 'RU', | ||||||||||||||||||||||||||||
| 225 | }, | ||||||||||||||||||||||||||||
| 226 | loc => { | ||||||||||||||||||||||||||||
| 227 | first_name => 'Игорь', | ||||||||||||||||||||||||||||
| 228 | patronymic => 'Игоревич', | ||||||||||||||||||||||||||||
| 229 | last_name => 'Игорев', | ||||||||||||||||||||||||||||
| 230 | org => '', | ||||||||||||||||||||||||||||
| 231 | addr => 'ул. Игорева, 129', | ||||||||||||||||||||||||||||
| 232 | city => 'Игоревск', | ||||||||||||||||||||||||||||
| 233 | state => 'Игоревская обл.', | ||||||||||||||||||||||||||||
| 234 | postcode => '699001', | ||||||||||||||||||||||||||||
| 235 | country_code => 'RU', | ||||||||||||||||||||||||||||
| 236 | }, | ||||||||||||||||||||||||||||
| 237 | birthday => '1909-01-14', | ||||||||||||||||||||||||||||
| 238 | passport => '11.11.2011, выдан Отделом УФМС России по Игоревской области в г.Игоревске, 2211 446622', | ||||||||||||||||||||||||||||
| 239 | phone => '+7.9012345678', | ||||||||||||||||||||||||||||
| 240 | fax => '', | ||||||||||||||||||||||||||||
| 241 | email => 'igor@i.ru', | ||||||||||||||||||||||||||||
| 242 | TIN => '', | ||||||||||||||||||||||||||||
| 243 | }; | ||||||||||||||||||||||||||||
| 244 | |||||||||||||||||||||||||||||
| 245 | my ( $answ, $msg, $conn ) = make_request( 'create_contact', \%cont ); | ||||||||||||||||||||||||||||
| 246 | |||||||||||||||||||||||||||||
| 247 | Legal entities: | ||||||||||||||||||||||||||||
| 248 | |||||||||||||||||||||||||||||
| 249 | my %cont = ( | ||||||||||||||||||||||||||||
| 250 | int => { | ||||||||||||||||||||||||||||
| 251 | first_name => 'Igor', | ||||||||||||||||||||||||||||
| 252 | patronymic => 'Igorevich', | ||||||||||||||||||||||||||||
| 253 | last_name => 'Igorev', | ||||||||||||||||||||||||||||
| 254 | org => 'Igor and Co', | ||||||||||||||||||||||||||||
| 255 | addr => 'Igoreva str, 129', | ||||||||||||||||||||||||||||
| 256 | city => 'Igorevsk', | ||||||||||||||||||||||||||||
| 257 | state => 'Igorevskaya obl.', | ||||||||||||||||||||||||||||
| 258 | postcode => '699001', | ||||||||||||||||||||||||||||
| 259 | country_code => 'RU', | ||||||||||||||||||||||||||||
| 260 | }, | ||||||||||||||||||||||||||||
| 261 | loc => { | ||||||||||||||||||||||||||||
| 262 | first_name => 'Игорь', | ||||||||||||||||||||||||||||
| 263 | patronymic => 'Игоревич', | ||||||||||||||||||||||||||||
| 264 | last_name => 'Игорев', | ||||||||||||||||||||||||||||
| 265 | org => 'Игорь и Ко', | ||||||||||||||||||||||||||||
| 266 | addr => 'ул. Игорева, 129', | ||||||||||||||||||||||||||||
| 267 | city => 'Игоревск', | ||||||||||||||||||||||||||||
| 268 | state => 'Игоревская обл.', | ||||||||||||||||||||||||||||
| 269 | postcode => '699001', | ||||||||||||||||||||||||||||
| 270 | country_code => 'RU', | ||||||||||||||||||||||||||||
| 271 | }, | ||||||||||||||||||||||||||||
| 272 | legal => { | ||||||||||||||||||||||||||||
| 273 | int => { | ||||||||||||||||||||||||||||
| 274 | addr => 'Company str, 1', | ||||||||||||||||||||||||||||
| 275 | city => 'Igorevsk', | ||||||||||||||||||||||||||||
| 276 | state => 'Igorevskaya obl.', | ||||||||||||||||||||||||||||
| 277 | postcode => '699002', | ||||||||||||||||||||||||||||
| 278 | country_code => 'RU', | ||||||||||||||||||||||||||||
| 279 | }, | ||||||||||||||||||||||||||||
| 280 | loc => { | ||||||||||||||||||||||||||||
| 281 | addr => 'ул. Компаний, 1', | ||||||||||||||||||||||||||||
| 282 | city => 'Игоревск', | ||||||||||||||||||||||||||||
| 283 | state => 'Игоревская обл.', | ||||||||||||||||||||||||||||
| 284 | postcode => '699002', | ||||||||||||||||||||||||||||
| 285 | country_code => 'RU', | ||||||||||||||||||||||||||||
| 286 | } | ||||||||||||||||||||||||||||
| 287 | } | ||||||||||||||||||||||||||||
| 288 | }; | ||||||||||||||||||||||||||||
| 289 | |||||||||||||||||||||||||||||
| 290 | my ( $answ, $code, $msg ) = $conn->create_contact( \%cont ); | ||||||||||||||||||||||||||||
| 291 | |||||||||||||||||||||||||||||
| 292 | =cut | ||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||
| 294 | sub create_contact { | ||||||||||||||||||||||||||||
| 295 | 0 | ▶ | my ( $self, $params ) = @_; | ||||||||||||||||||||||||||
|
Subroutine
create_contact: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 296 | |||||||||||||||||||||||||||||
| 297 | 0 | $params->{cont_id} = IO::EPP::Base::gen_id( 16 ); | |||||||||||||||||||||||||||
| 298 | |||||||||||||||||||||||||||||
| 299 | 0 | $params->{authinfo} = IO::EPP::Base::gen_pw( 16 ); | |||||||||||||||||||||||||||
| 300 | |||||||||||||||||||||||||||||
| 301 | 0 | my $extension = $self->contact_ext( $params ); | |||||||||||||||||||||||||||
| 302 | |||||||||||||||||||||||||||||
| 303 | 0 | ▶ | if ( $extension ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 304 | 0 | $params->{extension} = " <contact:create $cont_ext>\n$extension </contact:create>\n"; | |||||||||||||||||||||||||||
| 305 | } | ||||||||||||||||||||||||||||
| 306 | |||||||||||||||||||||||||||||
| 307 | 0 | return $self->SUPER::create_contact( $params ); | |||||||||||||||||||||||||||
| 308 | } | ||||||||||||||||||||||||||||
| 309 | |||||||||||||||||||||||||||||
| 310 | |||||||||||||||||||||||||||||
| 311 | sub get_contact_ext { | ||||||||||||||||||||||||||||
| 312 | 0 | ▶ | my ( undef, $ext ) = @_; | ||||||||||||||||||||||||||
|
Subroutine
get_contact_ext: not called CC=8 SCAR=42.8
Pod
documented
| |||||||||||||||||||||||||||||
| 313 | |||||||||||||||||||||||||||||
| 314 | 0 | my %cont; | |||||||||||||||||||||||||||
| 315 | |||||||||||||||||||||||||||||
| 316 | 0 | ▶ | if ( $ext =~ m|<contact:infData[^<>]+tci-contact-ext-1[^<>]+>(.+?)</contact:infData>|s ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 317 | 0 | my $data = $1; | |||||||||||||||||||||||||||
| 318 | |||||||||||||||||||||||||||||
| 319 | 0 | ▶ | if ( $data =~ m|<contact:person>(.+)</contact:person>|s ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 320 | 0 | my $person_data = $1; | |||||||||||||||||||||||||||
| 321 | |||||||||||||||||||||||||||||
| 322 | 0 | my @rows = $person_data =~ m|(<contact:[A-Za-z]+>[^<>]+)</contact:[A-Za-z]+>|gs; | |||||||||||||||||||||||||||
| 323 | |||||||||||||||||||||||||||||
| 324 | 0 | foreach my $row ( @rows ) { | |||||||||||||||||||||||||||
| 325 | 0 | ▶ | if ( $row =~ m|<contact:([A-Za-z]+)>([^<>]+)| ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 326 | 0 | $cont{$1} = $2; | |||||||||||||||||||||||||||
| 327 | } | ||||||||||||||||||||||||||||
| 328 | } | ||||||||||||||||||||||||||||
| 329 | } | ||||||||||||||||||||||||||||
| 330 | |||||||||||||||||||||||||||||
| 331 | 0 | ▶ | if ( $data =~ m|<contact:organization>(.+)</contact:organization>|s ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 332 | 0 | my $org_data = $1; | |||||||||||||||||||||||||||
| 333 | |||||||||||||||||||||||||||||
| 334 | 0 | ( $cont{TIN} ) = $org_data =~ /<contact:TIN>([^<>]+)<\/contact:TIN>/; | |||||||||||||||||||||||||||
| 335 | |||||||||||||||||||||||||||||
| 336 | 0 | my @atypes = ( 'int', 'loc' ); | |||||||||||||||||||||||||||
| 337 | 0 | foreach my $atype ( @atypes ) { | |||||||||||||||||||||||||||
| 338 | 0 | my ( $postal ) = $org_data =~ m|<contact:legalAddr type="$atype">(.+?)</contact:legalAddr>|s; | |||||||||||||||||||||||||||
| 339 | |||||||||||||||||||||||||||||
| 340 | 0 | ▶ | next unless $postal; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 341 | |||||||||||||||||||||||||||||
| 342 | 0 | $cont{legal}{$atype}{addr} = join(' ', $postal =~ /<contact:street>([^<>]*)<\/contact:street>/ ); | |||||||||||||||||||||||||||
| 343 | |||||||||||||||||||||||||||||
| 344 | 0 | ( $cont{legal}{$atype}{city} ) = $postal =~ /<contact:city>([^<>]*)<\/contact:city>/; | |||||||||||||||||||||||||||
| 345 | |||||||||||||||||||||||||||||
| 346 | 0 | ( $cont{legal}{$atype}{'state'} ) = $postal =~ /<contact:sp>([^<>]*)<\/contact:sp>/; | |||||||||||||||||||||||||||
| 347 | |||||||||||||||||||||||||||||
| 348 | 0 | ( $cont{legal}{$atype}{postcode} ) = $postal =~ /<contact:pc>([^<>]*)<\/contact:pc>/; | |||||||||||||||||||||||||||
| 349 | |||||||||||||||||||||||||||||
| 350 | 0 | ( $cont{legal}{$atype}{country_code} ) = $postal =~ /<contact:cc>([A-Z]+)<\/contact:cc>/; | |||||||||||||||||||||||||||
| 351 | } | ||||||||||||||||||||||||||||
| 352 | } | ||||||||||||||||||||||||||||
| 353 | } | ||||||||||||||||||||||||||||
| 354 | |||||||||||||||||||||||||||||
| 355 | 0 | return \%cont; | |||||||||||||||||||||||||||
| 356 | } | ||||||||||||||||||||||||||||
| 357 | |||||||||||||||||||||||||||||
| 358 | =head2 create_domain | ||||||||||||||||||||||||||||
| 359 | |||||||||||||||||||||||||||||
| 360 | Domains ru.net+ tlds have only the registrant, without the administrator and other contacts | ||||||||||||||||||||||||||||
| 361 | |||||||||||||||||||||||||||||
| 362 | =cut | ||||||||||||||||||||||||||||
| 363 | |||||||||||||||||||||||||||||
| 364 | sub create_domain { | ||||||||||||||||||||||||||||
| 365 | 0 | ▶ | my ( $self, $params ) = @_; | ||||||||||||||||||||||||||
|
Subroutine
create_domain: not called CC=7 SCAR=40.3
Pod
documented
| |||||||||||||||||||||||||||||
| 366 | |||||||||||||||||||||||||||||
| 367 | 0 | ▶ | $params->{authinfo} ||= IO::EPP::Base::gen_pw( 16 ); | ||||||||||||||||||||||||||
|
Condition0%0/3
$params->{"authinfo"} ||= IO::EPP::Base::gen_pw(16)
MC/DC0%0/2
$params->{"authinfo"} ||= IO::EPP::Base::gen_pw(16)
$params->{"authinfo"}
IO::EPP::Base::gen_pw(16)
Truth table0%0/3
A ||= B
A= $params->{"authinfo"}B= IO::EPP::Base::gen_pw(16)
| |||||||||||||||||||||||||||||
| 368 | |||||||||||||||||||||||||||||
| 369 | 0 | my $extension = ''; | |||||||||||||||||||||||||||
| 370 | |||||||||||||||||||||||||||||
| 371 | 0 | ▶ | if ( $params->{dname} =~ /\.xn--80adxhks$/ ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 372 | # .москва support RU lang only | ||||||||||||||||||||||||||||
| 373 | 0 | $extension .= qq| <idn:data xmlns:idn="urn:ietf:params:xml:ns:idn-1.0">\n|; | |||||||||||||||||||||||||||
| 374 | 0 | $extension .= " <idn:table>ru-RU</idn:table>\n"; | |||||||||||||||||||||||||||
| 375 | 0 | $extension .= " </idn:data>\n"; | |||||||||||||||||||||||||||
| 376 | } | ||||||||||||||||||||||||||||
| 377 | |||||||||||||||||||||||||||||
| 378 | 0 | ▶ | if ( $params->{price} or $params->{fee} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$params->{"price"} or $params->{"fee"}
MC/DC0%0/2
$params->{"price"} or $params->{"fee"}
$params->{"price"}
$params->{"fee"}
Truth table0%0/3
A or B
A= $params->{"price"}B= $params->{"fee"}
| |||||||||||||||||||||||||||||
| 379 | 0 | ▶ | my $price = $params->{price} || $params->{fee}; | ||||||||||||||||||||||||||
|
Condition0%0/3
$params->{'price'} || $params->{'fee'}
MC/DC0%0/2
$params->{'price'} || $params->{'fee'}
$params->{'price'}
$params->{'fee'}
Truth table0%0/3
A || B
A= $params->{'price'}B= $params->{'fee'}
| |||||||||||||||||||||||||||||
| 380 | # Russian Ruble only | ||||||||||||||||||||||||||||
| 381 | 0 | $extension .= qq| <fee:create xmlns:fee="urn:ietf:params:xml:ns:fee-0.11">\n|; | |||||||||||||||||||||||||||
| 382 | 0 | $extension .= " <fee:currency>RUB</fee:currency>\n"; | |||||||||||||||||||||||||||
| 383 | 0 | $extension .= " <fee:fee>$price</fee:fee>\n"; | |||||||||||||||||||||||||||
| 384 | 0 | $extension .= " </fee:create>\n"; | |||||||||||||||||||||||||||
| 385 | } | ||||||||||||||||||||||||||||
| 386 | |||||||||||||||||||||||||||||
| 387 | 0 | ▶ | $params->{extension} = $extension if $extension; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 388 | |||||||||||||||||||||||||||||
| 389 | 0 | return $self->SUPER::create_domain( $params ); | |||||||||||||||||||||||||||
| 390 | } | ||||||||||||||||||||||||||||
| 391 | |||||||||||||||||||||||||||||
| 392 | |||||||||||||||||||||||||||||
| 393 | sub get_domain_spec_ext { | ||||||||||||||||||||||||||||
| 394 | 0 | ▶ | my ( undef, $ext ) = @_; | ||||||||||||||||||||||||||
|
Subroutine
get_domain_spec_ext: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 395 | |||||||||||||||||||||||||||||
| 396 | 0 | my %info; | |||||||||||||||||||||||||||
| 397 | |||||||||||||||||||||||||||||
| 398 | 0 | ▶ | if ( $ext =~ /<idn:data xmlns:idn="urn:ietf:params:xml:ns:idn-1.0">(.+?)<\/idn:data>/s ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 399 | 0 | my $idn = $1; | |||||||||||||||||||||||||||
| 400 | |||||||||||||||||||||||||||||
| 401 | 0 | ( $info{uname} ) = $idn =~ /<idn:uname>([^<>]+)<\/idn:uname>/; | |||||||||||||||||||||||||||
| 402 | } | ||||||||||||||||||||||||||||
| 403 | |||||||||||||||||||||||||||||
| 404 | 0 | return \%info; | |||||||||||||||||||||||||||
| 405 | } | ||||||||||||||||||||||||||||
| 406 | |||||||||||||||||||||||||||||
| 407 | |||||||||||||||||||||||||||||
| 408 | sub renew_domain { | ||||||||||||||||||||||||||||
| 409 | 0 | ▶ | my ( $self, $params ) = @_; | ||||||||||||||||||||||||||
|
Subroutine
renew_domain: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||
| 410 | |||||||||||||||||||||||||||||
| 411 | 0 | my $extension = ''; | |||||||||||||||||||||||||||
| 412 | |||||||||||||||||||||||||||||
| 413 | 0 | ▶ | if ( $params->{price} or $params->{fee} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$params->{"price"} or $params->{"fee"}
MC/DC0%0/2
$params->{"price"} or $params->{"fee"}
$params->{"price"}
$params->{"fee"}
Truth table0%0/3
A or B
A= $params->{"price"}B= $params->{"fee"}
| |||||||||||||||||||||||||||||
| 414 | 0 | ▶ | my $price = $params->{price} || $params->{fee}; | ||||||||||||||||||||||||||
|
Condition0%0/3
$params->{'price'} || $params->{'fee'}
MC/DC0%0/2
$params->{'price'} || $params->{'fee'}
$params->{'price'}
$params->{'fee'}
Truth table0%0/3
A || B
A= $params->{'price'}B= $params->{'fee'}
| |||||||||||||||||||||||||||||
| 415 | # Russian Ruble only | ||||||||||||||||||||||||||||
| 416 | 0 | $extension .= qq| <fee:renew xmlns:fee="urn:ietf:params:xml:ns:fee-0.11">\n|; | |||||||||||||||||||||||||||
| 417 | 0 | $extension .= " <fee:currency>RUB</fee:currency>\n"; | |||||||||||||||||||||||||||
| 418 | 0 | $extension .= " <fee:fee>$price</fee:fee>\n"; | |||||||||||||||||||||||||||
| 419 | 0 | $extension .= " </fee:renew>\n"; | |||||||||||||||||||||||||||
| 420 | } | ||||||||||||||||||||||||||||
| 421 | |||||||||||||||||||||||||||||
| 422 | 0 | ▶ | $params->{extension} = $extension if $extension; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 423 | |||||||||||||||||||||||||||||
| 424 | 0 | return $self->SUPER::renew_domain( $params ); | |||||||||||||||||||||||||||
| 425 | } | ||||||||||||||||||||||||||||
| 426 | |||||||||||||||||||||||||||||
| 427 | |||||||||||||||||||||||||||||
| 428 | =head2 restore_domain | ||||||||||||||||||||||||||||
| 429 | |||||||||||||||||||||||||||||
| 430 | first call for restore_domain | ||||||||||||||||||||||||||||
| 431 | |||||||||||||||||||||||||||||
| 432 | =cut | ||||||||||||||||||||||||||||
| 433 | |||||||||||||||||||||||||||||
| 434 | sub restore_domain { | ||||||||||||||||||||||||||||
| 435 | 0 | ▶ | my ( $self, $params ) = @_; | ||||||||||||||||||||||||||
|
Subroutine
restore_domain: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 436 | |||||||||||||||||||||||||||||
| 437 | 0 | $params->{extension} = qq|<rgp:update $rgp_ext> | |||||||||||||||||||||||||||
| 438 | <rgp:restore op=\"request\"/> | ||||||||||||||||||||||||||||
| 439 | </rgp:update>|; | ||||||||||||||||||||||||||||
| 440 | |||||||||||||||||||||||||||||
| 441 | 0 | return $self->SUPER::update_domain( $params ); | |||||||||||||||||||||||||||
| 442 | } | ||||||||||||||||||||||||||||
| 443 | |||||||||||||||||||||||||||||
| 444 | |||||||||||||||||||||||||||||
| 445 | =head2 confirmations_restore_domain | ||||||||||||||||||||||||||||
| 446 | |||||||||||||||||||||||||||||
| 447 | Second call for restore_domain | ||||||||||||||||||||||||||||
| 448 | |||||||||||||||||||||||||||||
| 449 | =over 4 | ||||||||||||||||||||||||||||
| 450 | |||||||||||||||||||||||||||||
| 451 | =item C<pre_data> | ||||||||||||||||||||||||||||
| 452 | |||||||||||||||||||||||||||||
| 453 | whois before delete; | ||||||||||||||||||||||||||||
| 454 | |||||||||||||||||||||||||||||
| 455 | =item C<post_data> | ||||||||||||||||||||||||||||
| 456 | |||||||||||||||||||||||||||||
| 457 | whois on now; | ||||||||||||||||||||||||||||
| 458 | |||||||||||||||||||||||||||||
| 459 | =item C<del_time> | ||||||||||||||||||||||||||||
| 460 | |||||||||||||||||||||||||||||
| 461 | delete domain date-time, see. upd_date in domain:info before call restore_domain; | ||||||||||||||||||||||||||||
| 462 | |||||||||||||||||||||||||||||
| 463 | =item C<rest_time> | ||||||||||||||||||||||||||||
| 464 | |||||||||||||||||||||||||||||
| 465 | restore request call datetime in UTC; | ||||||||||||||||||||||||||||
| 466 | |||||||||||||||||||||||||||||
| 467 | =item C<reason> | ||||||||||||||||||||||||||||
| 468 | |||||||||||||||||||||||||||||
| 469 | restore reason, | ||||||||||||||||||||||||||||
| 470 | |||||||||||||||||||||||||||||
| 471 | variants: C<Registrant Error>, C<Registrar Error>, C<Judicial / Arbitral / Administrative / UDRP Order>; | ||||||||||||||||||||||||||||
| 472 | |||||||||||||||||||||||||||||
| 473 | =item C<statement> | ||||||||||||||||||||||||||||
| 474 | |||||||||||||||||||||||||||||
| 475 | need to write what it is for the client; | ||||||||||||||||||||||||||||
| 476 | |||||||||||||||||||||||||||||
| 477 | =item C<other> | ||||||||||||||||||||||||||||
| 478 | |||||||||||||||||||||||||||||
| 479 | can and without other. | ||||||||||||||||||||||||||||
| 480 | |||||||||||||||||||||||||||||
| 481 | =back | ||||||||||||||||||||||||||||
| 482 | |||||||||||||||||||||||||||||
| 483 | =cut | ||||||||||||||||||||||||||||
| 484 | |||||||||||||||||||||||||||||
| 485 | sub confirmations_restore_domain { | ||||||||||||||||||||||||||||
| 486 | 0 | ▶ | my ( $self, $params ) = @_; | ||||||||||||||||||||||||||
|
Subroutine
confirmations_restore_domain: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 487 | |||||||||||||||||||||||||||||
| 488 | 0 | $params->{extension} = <<RGPEXT; | |||||||||||||||||||||||||||
| 489 | <rgp:update $rgp_ext> | ||||||||||||||||||||||||||||
| 490 | <rgp:restore op="report"> | ||||||||||||||||||||||||||||
| 491 | <rgp:report> | ||||||||||||||||||||||||||||
| 492 | <rgp:preData>$$params{pre_data}</rgp:preData> | ||||||||||||||||||||||||||||
| 493 | <rgp:postData>$$params{post_data}</rgp:postData> | ||||||||||||||||||||||||||||
| 494 | <rgp:delTime>$$params{del_time}</rgp:delTime> | ||||||||||||||||||||||||||||
| 495 | <rgp:resTime>$$params{rest_time}</rgp:resTime> | ||||||||||||||||||||||||||||
| 496 | <rgp:resReason>$$params{reason}</rgp:resReason> | ||||||||||||||||||||||||||||
| 497 | <rgp:statement>$$params{statement}</rgp:statement> | ||||||||||||||||||||||||||||
| 498 | <rgp:other/> | ||||||||||||||||||||||||||||
| 499 | </rgp:report> | ||||||||||||||||||||||||||||
| 500 | </rgp:restore> | ||||||||||||||||||||||||||||
| 501 | </rgp:update> | ||||||||||||||||||||||||||||
| 502 | RGPEXT | ||||||||||||||||||||||||||||
| 503 | |||||||||||||||||||||||||||||
| 504 | 0 | return $self->SUPER::update_domain( $params ); | |||||||||||||||||||||||||||
| 505 | } | ||||||||||||||||||||||||||||
| 506 | |||||||||||||||||||||||||||||
| 507 | |||||||||||||||||||||||||||||
| 508 | 1 | 1; | |||||||||||||||||||||||||||
| 509 | |||||||||||||||||||||||||||||
| 510 | |||||||||||||||||||||||||||||
| 511 | __END__ | ||||||||||||||||||||||||||||