File Coverage

blib/lib/IO/EPP/Verisign.pm
Criterion Covered Total %
statement 116 236 49.1
branch 31 110 28.1
condition 23 54 42.5
subroutine 21 29 72.4
pod 24 25 96.0
total 215 454 47.3


line stmt bran cond sub pod time code
1             package IO::EPP::Verisign;
2              
3             =encoding utf8
4              
5             =head1 NAME
6              
7             IO::EPP::Verisign
8              
9             =head1 SYNOPSIS
10              
11             use IO::EPP::Verisign;
12              
13             # Parameters for IO::Socket::SSL
14             my %sock_params = (
15             PeerHost => 'epp.verisign-grs.com',
16             PeerPort => 700,
17             SSL_key_file => 'key_file.pem',
18             SSL_cert_file => 'cert_file.pem',
19             Timeout => 30,
20             );
21              
22             # Create object, get greeting and call login()
23             my $conn = IO::EPP::Verisign->new( {
24             user => 'login',
25             pass => 'XXXXX',
26             sock_params => \%sock_params,
27             server => 'Core', # or NameStore, or DotName
28             test_mode => 0, # real connect
29             } );
30              
31             # Check domain
32             my ( $answ, $code, $msg ) = $conn->check_domains( { domains => [ 'org.info' ] } );
33              
34             # Call logout() and destroy object
35             undef $conn;
36              
37             =head1 DESCRIPTION
38              
39             Work with Verisign EPP API
40              
41             Features:
42             Very mach extension, verisign here is leader. Absolutely all extensions have not yet been implemented
43              
44             docs:
45             L,
46             L (need white IP)
47              
48             for .name:
49             L
50              
51             =cut
52              
53 1     1   1218 use IO::EPP::Base;
  1         20  
  1         33  
54 1     1   6 use parent qw( IO::EPP::Base );
  1         1  
  1         6  
55              
56 1     1   53 use strict;
  1         1  
  1         15  
57 1     1   4 use warnings;
  1         1  
  1         2769  
58              
59             # not to change formatting:
60             our $sub_product_ext_begin =
61             '
62             ';
63             our $sub_product_ext_end =
64             '
65             ';
66             our $rgp_ext =
67             '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"';
68              
69             sub make_request {
70 26     26 1 8697 my ( $action, $params ) = @_;
71              
72 26         35 my ( $self, $code, $msg, $answ );
73              
74 26 100       57 unless ( $params->{conn} ) {
75 19   50     45 $params->{sock_params}{PeerHost} ||= 'epp.verisign-grs.com';
76 19   50     33 $params->{sock_params}{PeerPort} ||= 700;
77              
78 19         51 ( $self, $code, $msg ) = __PACKAGE__->new( $params );
79              
80 19 50 33     60 unless ( $code and $code == 1000 ) {
81 0         0 goto END_MR;
82             }
83             }
84             else {
85 7         14 $self = $params->{conn};
86             }
87              
88              
89             # You can change the zone if you do not change the server
90             # com <-> net <-> edu
91             # cc <-> tv <-> jobs <-> name <-> ... new gtld
92 26   100     64 my $tld = $self->{tld} || '';
93              
94 26 50 66     58 if ( not $tld and $params->{dname} ) {
95 0         0 ( $tld ) = $params->{dname} =~ /\.([^.]+)$/;
96             }
97              
98 26 100       44 if ( $tld ) {
99 17 50       33 if ( lc ( $tld ) eq 'name' ) {
100 0         0 $self->{dzone} = 'name';
101             }
102             else {
103 17         30 $self->{dzone} = 'dot' . uc( $tld );
104             }
105              
106 17         41 $self->{namestore_ext} = $sub_product_ext_begin . $self->{dzone} . $sub_product_ext_end ."\n";
107             }
108              
109              
110 26         37 $self->{critical_error} = '';
111              
112 26 50       85 if ( $self->can( $action ) ) {
113 26         55 ( $answ, $code, $msg ) = $self->$action( $params );
114             }
115             else {
116 0         0 $msg = "undefined command <$action>, request cancelled";
117 0         0 $code = 0;
118             }
119              
120              
121             END_MR:
122              
123 26 50       62 $msg .= '; ' . $self->{critical_error} if $self->{critical_error};
124              
125 26         62 my $full_answ = "code: $code\nmsg: $msg";
126              
127 26 50 33     84 $answ = {} unless $answ && ref $answ;
128              
129 26         49 $answ->{code} = $code;
130 26         37 $answ->{msg} = $msg;
131              
132 26 50       107 return wantarray ? ( $answ, $full_answ, $self ) : $answ;
133             }
134              
135              
136             sub req_test {
137 166     166 1 260 my ( $self, $out_data, $info ) = @_;
138              
139 166 100       568 $self->epp_log( "$info request:\n$out_data" ) if $out_data;
140              
141 166         208 my $answ;
142              
143 166 50       318 if ( $self->{server} eq 'Core' ) {
144 166         1343 require IO::EPP::Test::VerisignCore;
145              
146             eval{
147 166         345 $answ = IO::EPP::Test::VerisignCore::req( @_ );
148 166         340 1;
149             }
150 166 50       229 or do {
151 0         0 $self->{critical_error} = "$info req error: $@";
152 0         0 return;
153             };
154             }
155             else { # DotName, NameStore
156 0         0 require IO::EPP::Test::VerisignName;
157              
158             eval{
159 0         0 $answ = IO::EPP::Test::VerisignName::req( @_ );
160 0         0 1;
161             }
162 0 0       0 or do {
163 0         0 $self->{critical_error} = "$info req error: $@";
164 0         0 return;
165             };
166             }
167              
168 166         634 $self->epp_log( "$info answer:\n$answ" );
169              
170 166         370 return $answ;
171             }
172              
173              
174             =head2 new
175              
176             See description in L
177              
178             Requires the C field to be specified, which can have values: C for .com/.net/.edu, C for .name, C for cctld and new gtlds.
179              
180             =cut
181              
182             sub new {
183 28     28 1 6683 my ( $package, $params ) = @_;
184              
185 28 0 33     55 unless ( $params->{server} || $params->{dname} || $params->{tld} ) {
      0        
186 0 0       0 if ( $params->{sock_params}{PeerHost} =~ 'epp.verisign-grs.com' ) {
    0          
187 0         0 $params->{server} = 'Core';
188             }
189             elsif ( $params->{sock_params}{PeerHost} eq 'namestoressl.verisign-grs.com' ) {
190 0         0 $params->{server} = 'NameStore';
191             }
192             }
193              
194 28 0 33     45 unless ( $params->{server} or $params->{tld} or $params->{dname} ) {
      0        
195 0 0       0 return wantarray ? ( 0, 0, 'unknown server: Core or DotName, need set server, tld or dname field' ) : 0 ;
196             }
197              
198 28 100       74 $params->{dname} = lc $params->{dname} if $params->{dname};
199              
200 28   100     61 my $tld = $params->{tld} || '';
201              
202 28 50 66     59 if ( not $tld and $params->{dname} ) {
203 0         0 ( $tld ) = $params->{dname} =~ /\.([^.]+)$/;
204             }
205              
206 28 100 66     89 if ( $params->{server} and not $tld ) {
207 11 50       24 if ( $params->{server} eq 'Core' ) {
    0          
208 11         11 $tld = 'com';
209             }
210             elsif ( $params->{server} eq 'DotName' ) {
211 0         0 $tld = 'name';
212             }
213             else {
214 0         0 $tld = 'tv';
215             }
216             }
217              
218 28 50 33     82 if ( $tld and not $params->{server} ) {
219 0 0       0 if ( $tld eq 'name' ) {
    0          
220 0         0 $params->{server} = 'DotName';
221             }
222             elsif ( $tld =~ /^(com|net|edu)$/ ) {
223 0         0 $params->{server} = 'Core';
224             }
225             else {
226 0         0 $params->{server} = 'NameStore';
227             }
228             }
229              
230 28 50 33     50 $params->{server} = 'DotName' if $tld eq 'name' && $params->{server} ne 'DotName';
231              
232              
233 28         77 my ( $self, $code, $msg ) = $package->SUPER::new( $params );
234              
235 28 50 33     89 unless ( $code and $code == 1000 ) {
236 0 0       0 return wantarray ? ( 0, $code, $msg ) : 0;
237             }
238              
239 28 50       41 if ( $tld ) {
240 28 50       57 if ( lc ( $tld ) eq 'name' ) {
241 0         0 $self->{dzone} = 'name';
242             }
243             else {
244 28         63 $self->{dzone} = 'dot' . uc( $tld );
245             }
246              
247 28         67 $self->{namestore_ext} = $sub_product_ext_begin . $self->{dzone} . $sub_product_ext_end ."\n";
248             }
249              
250 28 100       80 return wantarray ? ( $self, $code, $msg ) : $self;
251             }
252              
253              
254             =head1 METHODS
255              
256             далее перекрываем те функции, где у провайдера есть особенности
257              
258             =head2 login
259              
260             залогиниться
261              
262             =cut
263              
264             sub login {
265 28     28 1 83 my ( $self, $pw ) = @_;
266              
267 28         37 my $svcs = '
268             urn:ietf:params:xml:ns:domain-1.0
269             urn:ietf:params:xml:ns:host-1.0
270             urn:ietf:params:xml:ns:contact-1.0
271             http://www.verisign.com/epp/lowbalance-poll-1.0';
272              
273 28         34 my $extension = '
274             urn:ietf:params:xml:ns:secDNS-1.1
275             http://www.verisign.com/epp/idnLang-1.0
276             http://www.verisign-grs.com/epp/namestoreExt-1.1
277             urn:ietf:params:xml:ns:rgp-1.0';
278              
279 28 50       50 if ( $self->{server} eq 'Core' ) {
    0          
    0          
280              
281 28         37 $svcs .= '
282             http://www.verisign.com/epp/registry-1.0
283             http://www.verisign.com/epp/rgp-poll-1.0';
284 28         38 $extension .= '
285             http://www.verisign.com/epp/whoisInf-1.0
286             urn:ietf:params:xml:ns:coa-1.0
287             http://www.verisign.com/epp/sync-1.0
288             http://www.verisign.com/epp/relatedDomain-1.0
289             urn:ietf:params:xml:ns:changePoll-1.0';
290              
291             }
292             elsif ( $self->{server} eq 'DotName' ) {
293             # moved to NameStore but extension in use
294             # https://www.verisign.com/assets/email-forwarding-mapping.pdf
295 0         0 $svcs .= '
296             http://www.nic.name/epp/nameWatch-1.0
297             http://www.nic.name/epp/emailFwd-1.0
298             http://www.nic.name/epp/defReg-1.0';
299 0         0 $extension .= '
300             http://www.nic.name/epp/persReg-1.0';
301              
302             }
303             elsif ( $self->{server} eq 'NameStore' ) {
304              
305 0         0 $svcs .= '
306             http://www.verisign.com/epp/rgp-poll-1.0
307             http://www.verisign.com/epp/balance-1.0
308             http://www.verisign-grs.com/epp/suggestion-1.1
309             http://www.verisign.com/epp/registry-1.0';
310 0         0 $extension .= '
311             http://www.verisign.com/epp/sync-1.0
312             http://www.verisign.com/epp/jobsContact-1.0
313             http://www.verisign.com/epp/premiumdomain-1.0
314             urn:ietf:params:xml:ns:launch-1.0
315             urn:ietf:params:xml:ns:verificationCode-1.0
316             urn:ietf:params:xml:ns:fee-0.9';
317              
318             }
319              
320 28         67 return $self->SUPER::login( $pw, $svcs, $extension );
321             }
322              
323              
324             sub check_contacts {
325 0     0 1 0 my ( $self, $params ) = @_;
326              
327 0         0 $params->{extension} = $self->{namestore_ext};
328              
329 0         0 return $self->SUPER::check_contacts( $params );
330             }
331              
332             =head2 create_contact
333              
334             For .jobs need additional parameters:
335             C, C, C, C.
336              
337             About .jobs parameters see L.
338              
339             =cut
340              
341             sub create_contact {
342 0     0 1 0 my ( $self, $params ) = @_;
343              
344 0   0     0 $params->{cont_id} ||= IO::EPP::Base::gen_id( 16 );
345              
346 0         0 $params->{authinfo} = IO::EPP::Base::gen_pw( 16 );
347              
348 0         0 my $extension = '';
349              
350 0 0       0 if ( $self->{dzone} eq 'dotJOBS' ) {
351 0         0 $extension .= q| \n|;
352 0         0 $extension .= " $$params{jobs_title}\n";
353 0         0 $extension .= " $$params{jobs_website}\n";
354 0         0 $extension .= " $$params{jobs_industry_type}\n";
355 0         0 $extension .= " $$params{is_admin}\n";
356 0         0 $extension .= " No\n";
357 0         0 $extension .= " \n";
358             }
359              
360 0         0 $params->{extension} = $extension . $self->{namestore_ext};
361              
362 0         0 return $self->SUPER::create_contact( $params );
363             }
364              
365              
366             sub get_contact_info {
367 0     0 1 0 my ( $self, $params ) = @_;
368              
369 0         0 $params->{extension} = $self->{namestore_ext};
370              
371 0         0 return $self->SUPER::get_contact_info( $params );
372             }
373              
374              
375             sub update_contact {
376 0     0 1 0 my ( $self, $params ) = @_;
377              
378 0         0 $params->{extension} = $self->{namestore_ext};
379              
380 0         0 return $self->SUPER::update_contact( $params );
381             }
382              
383              
384             sub delete_contact {
385 0     0 1 0 my ( $self, $params ) = @_;
386              
387 0         0 $params->{extension} = $self->{namestore_ext};
388              
389 0         0 return $self->SUPER::delete_contact( $params );
390             }
391              
392              
393             sub check_nss {
394 1     1 1 1 my ( $self, $params ) = @_;
395              
396 1         2 $params->{extension} = $self->{namestore_ext};
397              
398 1         5 return $self->SUPER::check_nss( $params );
399             }
400              
401              
402             sub create_ns {
403 9     9 1 1033 my ( $self, $params ) = @_;
404              
405 9         18 $params->{extension} = $self->{namestore_ext};
406              
407 9         25 return $self->SUPER::create_ns( $params );
408             }
409              
410              
411             sub get_ns_info {
412 4     4 1 3011 my ( $self, $params ) = @_;
413              
414 4         7 $params->{extension} = $self->{namestore_ext};
415              
416 4         13 return $self->SUPER::get_ns_info( $params );
417             }
418              
419              
420             sub update_ns {
421 13     13 1 11601 my ( $self, $params ) = @_;
422              
423 13         25 $params->{extension} = $self->{namestore_ext};
424              
425 13 50       30 $params->{no_empty_chg} = 1 unless $params->{chg};
426              
427 13         33 return $self->SUPER::update_ns( $params );
428             }
429              
430              
431             sub delete_ns {
432 3     3 1 2062 my ( $self, $params ) = @_;
433              
434 3         7 $params->{extension} = $self->{namestore_ext};
435              
436 3         10 return $self->SUPER::delete_ns( $params );
437             }
438              
439             sub check_domains {
440 1     1 1 2 my ( $self, $params ) = @_;
441              
442 1         2 $params->{extension} = $self->{namestore_ext};
443              
444 1         7 return $self->SUPER::check_domains( $params );
445             }
446              
447             =head2 create_domain
448              
449             For IDN domains you need to specify the language code in the C field
450              
451             See L,
452             and L for .com, .net
453              
454             =cut
455              
456             sub create_domain {
457 9     9 1 7974 my ( $self, $params ) = @_;
458              
459 9   66     35 $params->{authinfo} ||= IO::EPP::Base::gen_pw( 16 );
460              
461             # Do not change the order of records
462 9         13 my $extension = $self->{namestore_ext};
463              
464 9 50       17 if ( $params->{idn_lang} ) {
465             $extension .=
466             ' ' .
467             $params->{idn_lang} .
468 0         0 "\n";
469             }
470              
471 9         16 $params->{extension} = $extension;
472              
473 9         25 return $self->SUPER::create_domain( $params );
474             }
475              
476              
477             sub transfer {
478 0     0 1 0 my ( $self, $params ) = @_;
479              
480 0         0 $params->{extension} = $self->{namestore_ext};
481              
482 0 0       0 if ( defined $params->{authinfo} ) {
483 0         0 $params->{authinfo} =~ s/&/&/g;
484 0         0 $params->{authinfo} =~ s/
485 0         0 $params->{authinfo} =~ s/>/>/g;
486             }
487              
488 0         0 return $self->SUPER::transfer( $params );
489             }
490              
491              
492             sub get_domain_info {
493 10     10 1 6813 my ( $self, $params ) = @_;
494              
495 10         20 $params->{extension} = $self->{namestore_ext};
496              
497 10         34 return $self->SUPER::get_domain_info( $params );
498             }
499              
500              
501             sub renew_domain {
502 6     6 1 4618 my ( $self, $params ) = @_;
503              
504 6         14 $params->{extension} = $self->{namestore_ext};
505              
506 6         17 return $self->SUPER::renew_domain( $params );
507             }
508              
509              
510             sub update_domain {
511 17     17 1 1582 my ( $self, $params ) = @_;
512              
513 17         33 $params->{extension} = $self->{namestore_ext};
514              
515 17         47 return $self->SUPER::update_domain( $params );
516             }
517              
518              
519             sub delete_domain {
520 6     6 1 3900 my ( $self, $params ) = @_;
521              
522 6         17 $params->{extension} = $self->{namestore_ext};
523              
524 6         18 return $self->SUPER::delete_domain( $params );
525             }
526              
527              
528             =head2 restore_domain
529              
530             First call of restore — request
531              
532             =cut
533              
534             sub restore_domain {
535 1     1 1 7 my ( $self, $params ) = @_;
536              
537             $params->{extension} = $self->{namestore_ext} .
538 1         4 "
539            
540            
541             ";
542              
543 1         4 return $self->SUPER::update_domain( $params );
544             }
545              
546              
547             =head2 confirmations_restore_domain
548              
549             Secont call of restore — confirmation
550              
551             C — whois before delete, may be none;
552             C — whois now, may be none;
553             C — domain delete datetime in UTC;
554             C — restore request call datetime in UTC.
555              
556             The following fields already contain the required value, they do not need to be passed:
557             C — restore reason;
558             C — need to write what it is for the client;
559             C — additional information, may be empty.
560              
561             =cut
562              
563             sub confirmations_restore_domain {
564 1     1 1 803 my ( $self, $params ) = @_;
565              
566 1         2 my $extension = $self->{namestore_ext};
567              
568 1   50     7 $params->{pre_data} ||= 'none';
569 1   50     4 $params->{post_data} ||= 'none';
570              
571 1         7 $params->{extension} = <
572             $extension
573            
574            
575            
576             $$params{pre_data}
577             $$params{post_data}
578             $$params{del_time}
579             $$params{rest_time}
580             Customer forgot to renew.
581             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.
582             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.
583            
584            
585            
586            
587             RGPEXT
588              
589 1         4 return $self->SUPER::update_domain( $params );
590             }
591              
592              
593             sub req_poll_ext {
594 0     0 0   my ( $self, $ext ) = @_;
595              
596 0           my %info;
597              
598 0 0         if ( $ext =~ m|]+>(.+)|s ) {
599 0           $info{change}{'state'} = $1;
600 0           my $row = $2;
601              
602 0 0         if ( $row =~ s|([^<>]+)|| ) {
603 0           $info{change}{date} = $1;
604              
605 0           $info{change}{date} =~ s/T/ /;
606 0           $info{change}{date} =~ s/Z$//;
607             }
608              
609 0 0         if ( $row =~ s|([^<>]+)|| ) {
610 0           $info{change}{who} = $1;
611             }
612              
613 0 0         if ( $row =~ s|([^<>]+)|| ) {
614 0           $info{change}{svtrid} = $1;
615             }
616              
617 0 0         if ( $row =~ s|([^<>]+)|| ) {
618 0           $info{change}{reason} = $1;
619             }
620              
621 0           $info{change}{row_msg} = $row;
622             }
623             else {
624 0           $info{ext} = $ext;
625             }
626              
627 0           return \%info;
628             }
629              
630              
631             =head2 get_registry_info
632              
633             Registry information for the specified zone
634              
635             key in params: C
636              
637             An Example:
638              
639             my ( $answ, $code, $msg ) = $conn->get_registry_info( { tld => 'net' } );
640              
641             # answer
642              
643             {
644             'alphaNumStart' => 'true',
645             'max' => [
646             '13',
647             '13'
648             ],
649             'language code' => [
650             'ARG',
651             'ASM',
652             'AST',
653             'AVE',
654             'AWA',
655             'BAK',
656             'BAL',
657             'BAN',
658             'BAS',
659             'BEL',
660             'BOS',
661             'CAR',
662             'CHE',
663             'CHV',
664             'COP',
665             'COS',
666             'WEL',
667             'DIV',
668             'DOI',
669             'FIJ',
670             'FRY',
671             'GLA',
672             'GLE',
673             'GON',
674             'INC',
675             'IND',
676             'INH',
677             'JAV',
678             'KAS',
679             'KAZ',
680             'KHM',
681             'KIR',
682             'LTZ',
683             'MAO',
684             'MAY',
685             'MLT',
686             'MOL',
687             'MON',
688             'OSS',
689             'PUS',
690             'SIN',
691             'SMO',
692             'SOM',
693             'SRD',
694             'TGK',
695             'YID',
696             'AFR',
697             'ALB',
698             'ARA',
699             'ARM',
700             'AZE',
701             'BAQ',
702             'BEN',
703             'BHO',
704             'TIB',
705             'BUL',
706             'BUR',
707             'CAT',
708             'CZE',
709             'CHI',
710             'DAN',
711             'GER',
712             'DUT',
713             'GRE',
714             'ENG',
715             'EST',
716             'FAO',
717             'PER',
718             'FIN',
719             'FRE',
720             'GEO',
721             'GUJ',
722             'HEB',
723             'HIN',
724             'SCR',
725             'HUN',
726             'ICE',
727             'ITA',
728             'JPN',
729             'KOR',
730             'KUR',
731             'LAO',
732             'LAV',
733             'LIT',
734             'MAC',
735             'MAL',
736             'NEP',
737             'NOR',
738             'ORI',
739             'PAN',
740             'POL',
741             'POR',
742             'RAJ',
743             'RUM',
744             'RUS',
745             'SAN',
746             'SCC',
747             'SLO',
748             'SLV',
749             'SND',
750             'SPA',
751             'SWA',
752             'SWE',
753             'SYR',
754             'TAM',
755             'TEL',
756             'THA',
757             'TUR',
758             'UKR',
759             'URD',
760             'UZB',
761             'VIE'
762             ],
763             'gracePeriod command:transfer unit:d' => '5',
764             'gracePeriod command:create unit:d' => '5',
765             'default unit:y' => [
766             '1',
767             '1',
768             '1'
769             ],
770             'gracePeriod command:autorenew unit:d' => '45',
771             'subProduct' => 'NET',
772             'idnVersion' => '1.1',
773             'expression' => [
774             '[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?',
775             '^(?=.*\\\\d)(?=.*[a-zA-Z])(?=.*[\\\\x21-\\\\x2F\\\\x3A-\\\\x40\\\\x5B-\\\\x60\\\\x7B-\\\\x7E])[\\\\x21-\\\\x7e]{8,32}$',
776             '^([\\-|\\w])+\\.([\\-|\\w])+\\s{0,}$)$'
777             ],
778             'redemptionPeriod unit:d' => '30',
779             'encoding' => 'PunyCode',
780             'max unit:y' => [
781             '10',
782             '10',
783             '1'
784             ],
785             'name' => 'NET',
786             'maxCheckHost' => '20',
787             'urgent' => 'false',
788             'default' => '604800',
789             'onlyDnsChars' => 'true',
790             'maxCheckDomain' => '20',
791             'transferHoldPeriod unit:d' => '5',
792             'digestType' => [
793             'SHA-1',
794             'SHA-256',
795             'GOST R 34.11-94',
796             'SHA-384'
797             ],
798             'alg' => [
799             'RSAMD5',
800             'DH',
801             'DSA',
802             'RSASHA1',
803             'DSA-NSEC3-SHA1',
804             'RSASHA1-NSEC3-SHA1',
805             'RSASHA256',
806             'RSASHA512',
807             'ECC-GOST',
808             'ECDSAP256SHA256',
809             'ECDSAP384SHA384'
810             ],
811             'startDate' => '2000-01-01T00:00:00Z',
812             'minLength' => '3',
813             'status' => [
814             'ok',
815             'serverHold',
816             'serverRenewProhibited',
817             'serverTransferProhibited',
818             'serverUpdateProhibited',
819             'serverDeleteProhibited',
820             'redemptionPeriod',
821             'pendingRestore',
822             'pendingDelete',
823             'clientRenewProhibited',
824             'clientTransferProhibited',
825             'clientUpdateProhibited',
826             'clientDeleteProhibited',
827             'pendingTransfer',
828             'clientHold',
829             'ok',
830             'pendingDelete',
831             'pendingTransfer',
832             'serverUpdateProhibited',
833             'serverDeleteProhibited',
834             'clientUpdateProhibited',
835             'clientDeleteProhibited',
836             'linked'
837             ],
838             'zoneMember type:equal' => 'NET',
839             'group' => 'THIN',
840             'clientDefined' => 'false',
841             'pendingRestore unit:d' => '7',
842             'minIP' => [
843             '1',
844             '0'
845             ],
846             'extURI required:true' => [
847             'urn:ietf:params:xml:ns:coa-1.0',
848             'http://www.verisign.com/epp/idnLang-1.0',
849             'urn:ietf:params:xml:ns:secDNS-1.1',
850             'http://www.verisign-grs.com/epp/namestoreExt-1.1',
851             'urn:ietf:params:xml:ns:rgp-1.0',
852             'http://www.verisign.com/epp/whoisInf-1.0',
853             'http://www.verisign.com/epp/sync-1.0',
854             'http://www.verisign.com/epp/relatedDomain-1.0',
855             'urn:ietf:params:xml:ns:launch-1.0'
856             ],
857             'upDate' => '2013-08-10T21:16:01Z',
858             'min unit:y' => [
859             '1',
860             '1',
861             '1'
862             ],
863             'unicodeVersion' => '6.0',
864             'commingleAllowed' => 'false',
865             'pendingDelete unit:d' => '5',
866             'sharePolicy' => [
867             'perSystem',
868             'perSystem'
869             ],
870             'min' => [
871             '0',
872             '0',
873             '1'
874             ],
875             'idnaVersion' => 'IDNA 2008',
876             'objURI required:true' => [
877             'urn:ietf:params:xml:ns:domain-1.0',
878             'urn:ietf:params:xml:ns:contact-1.0',
879             'urn:ietf:params:xml:ns:host-1.0',
880             'http://www.verisign.com/epp/registry-1.0',
881             'http://www.verisign.com/epp/lowbalance-poll-1.0',
882             'http://www.verisign.com/epp/rgp-poll-1.0'
883             ],
884             'crDate' => '2000-01-01T00:00:00Z',
885             'premiumSupport' => 'false',
886             'alphaNumEnd' => 'true',
887             'gracePeriod command:renew unit:d' => '5',
888             'maxLength' => '63',
889             'maxIP' => [
890             '13',
891             '0'
892             ],
893             'contactsSupported' => 'false'
894             };
895              
896             =cut
897              
898             sub get_registry_info {
899 0     0 1   my ( $self, $params ) = @_;
900              
901 0           my $tld = uc( $params->{tld} );
902              
903 0           my $cltrid = IO::EPP::Base::get_cltrid();
904              
905 0           my $body = <
906             $$self{urn}{head}
907            
908            
909            
910             $tld
911            
912            
913             $cltrid
914            
915            
916             RINFO
917              
918 0           my $content = $self->req( $body, 'get_registry_info' );
919              
920 0 0         if ( $content =~ /result code=['"](\d+)['"]/ ) {
921 0           my $rcode = $1 + 0;
922              
923 0           my $msg = '';
924 0 0         if ( $content =~ /]*>(.+)<\/msg>.+\/result>/s ) {
925 0           $msg = $1;
926             }
927              
928 0           my %info;
929              
930             # take the main part and disassemble
931 0 0         if ( $content =~ /(.+)<\/resData>/s ) {
932 0           my $rdata = $1;
933              
934 0           my @list = $rdata =~ m|(]+>[^<>]+]+>)|g;
935              
936 0           foreach my $row ( @list ) {
937 0 0         if ( $row =~ m|([^<>]+)]+>| ) {
    0          
    0          
938 0           my $k = $1;
939              
940 0           push @{$info{$k}}, $2;
  0            
941             }
942             elsif ( $row =~ m|([^<>]+)]+>| ) {
943 0           my $k = "$1 $2:$3";
944              
945 0           push @{$info{$k}}, $4;
  0            
946             }
947             elsif ( $row =~ m|([^<>]+)]+>| ) {
948 0           my $k = "$1 $2:$3 $4:$5";
949              
950 0           push @{$info{$k}}, $6;
  0            
951             }
952             }
953              
954 0           @list = $rdata =~ m|(]+/>)|g;
955              
956 0           foreach my $row ( @list ) {
957 0 0         if ( $row =~ m|| ) {
958 0           my $k .= "$1 $2";
959              
960 0           push @{$info{$k}}, "$3";
  0            
961             }
962             }
963              
964 0           foreach my $k ( keys %info ) {
965 0 0         if ( ( scalar @{$info{$k}} ) == 1 ) {
  0            
966 0           $info{$k} = $info{$k}[0];
967             }
968             }
969             }
970             else {
971 0 0         return wantarray ? ( 0, $rcode, $msg ) : 0 ;
972             }
973              
974 0 0         return wantarray ? ( \%info, $rcode, $msg ) : \%info;
975             }
976              
977 0 0         return wantarray ? ( 0, 0, 'empty answer' ) : 0 ;
978             }
979              
980              
981             1;
982              
983              
984             __END__