| 1 | ## Domain Registry Interface, AFNIC EPP Domain extensions | ||||||||||||||||||||||||||||||||||||||||||
| 2 | ## | ||||||||||||||||||||||||||||||||||||||||||
| 3 | ## Copyright (c) 2008-2010,2012,2013,2016,2018 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::AFNIC::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 | 1 | ▶ | use feature 'state'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||
| 21 | 1 | ▶ | use Net::DRI::Util; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | 1 | ▶ | use Net::DRI::Exception; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||
| 24 | =pod | ||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||
| 28 | Net::DRI::Protocol::EPP::Extensions::AFNIC::Domain - AFNIC (.FR/.RE/.TF/.WF/.PM/.YT) EPP Domain extensions for Net::DRI | ||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||
| 30 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | Please see the README file for details. | ||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||
| 34 | =head1 SUPPORT | ||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||
| 36 | For now, support questions should be sent to: | ||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||
| 38 | E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||
| 40 | Please also see the SUPPORT file in the distribution. | ||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||
| 42 | =head1 SEE ALSO | ||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||
| 44 | E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||
| 46 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||
| 48 | Patrick Mevzek, E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||
| 50 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||
| 52 | Copyright (c) 2008-2010,2012,2013,2016,2018 Patrick Mevzek <netdri@dotandco.com>. | ||||||||||||||||||||||||||||||||||||||||||
| 53 | All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||
| 55 | This program is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||||||||||||||||
| 56 | it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||||||||||||||||
| 57 | the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||||||||||||||||||||||||
| 58 | (at your option) any later version. | ||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||
| 60 | See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||
| 62 | =cut | ||||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||
| 64 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 65 | |||||||||||||||||||||||||||||||||||||||||||
| 66 | sub register_commands | ||||||||||||||||||||||||||||||||||||||||||
| 67 | { | ||||||||||||||||||||||||||||||||||||||||||
| 68 | 0 | ▶ | my ($class,$version)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
register_commands: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 69 | 0 | state $rops = { domain => { | |||||||||||||||||||||||||||||||||||||||||
| 70 | create => [ \&create, undef ], | ||||||||||||||||||||||||||||||||||||||||||
| 71 | update => [ \&update, undef ], | ||||||||||||||||||||||||||||||||||||||||||
| 72 | transfer_request => [ \&transfer_request, undef ], | ||||||||||||||||||||||||||||||||||||||||||
| 73 | trade_request => [ \&trade_request, \&trade_parse ], | ||||||||||||||||||||||||||||||||||||||||||
| 74 | trade_query => [ \&trade_query, \&trade_parse ], | ||||||||||||||||||||||||||||||||||||||||||
| 75 | trade_cancel => [ \&trade_cancel, undef ], | ||||||||||||||||||||||||||||||||||||||||||
| 76 | recover_request => [ \&recover_request, \&recover_parse], | ||||||||||||||||||||||||||||||||||||||||||
| 77 | check => [ undef, \&check_parse], | ||||||||||||||||||||||||||||||||||||||||||
| 78 | check_multi => [ undef, \&check_parse], | ||||||||||||||||||||||||||||||||||||||||||
| 79 | info => [ undef, \&info_parse], | ||||||||||||||||||||||||||||||||||||||||||
| 80 | } | ||||||||||||||||||||||||||||||||||||||||||
| 81 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||||
| 83 | 0 | return $rops; | |||||||||||||||||||||||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||||||||||||||
| 86 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||
| 88 | sub build_domain | ||||||||||||||||||||||||||||||||||||||||||
| 89 | { | ||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | ▶ | my ($domain)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
build_domain: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 91 | 0 | ▶ | Net::DRI::Exception->die(1,'protocol/EPP',2,'Domain name needed') unless defined($domain) && $domain; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $domain and $domain
MC/DC0%0/2
defined $domain and $domain
defined $domain
$domain
Truth table0%0/3
A and B
A= defined $domainB= $domain
| |||||||||||||||||||||||||||||||||||||||||||
| 92 | 0 | ▶ | Net::DRI::Exception->die(1,'protocol/EPP',10,'Invalid domain name: '.$domain) unless Net::DRI::Util::is_hostname($domain); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | return ['frnic:name',$domain]; | |||||||||||||||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||
| 96 | sub build_registrant | ||||||||||||||||||||||||||||||||||||||||||
| 97 | { | ||||||||||||||||||||||||||||||||||||||||||
| 98 | 0 | ▶ | my ($rd)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
build_registrant: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 99 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('AFNIC needs contacts for domain operations') unless Net::DRI::Util::has_contact($rd); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 100 | 0 | my @t=$rd->{contact}->get('registrant'); | |||||||||||||||||||||||||||||||||||||||||
| 101 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('AFNIC needs one contact of type registrant') unless (@t==1 && Net::DRI::Util::isa_contact($t[0],'Net::DRI::Data::Contact::AFNIC')); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@t == 1 and Net::DRI::Util::isa_contact($t[0], "Net::DRI::Data::Contact::AFNIC")
MC/DC0%0/2
@t == 1 and Net::DRI::Util::isa_contact($t[0], "Net::DRI::Data::Contact::AFNIC")
@t == 1
Net::DRI::Util::isa_contact($t[0], "Net::DRI::Data::Contact::AFNIC")
Truth table0%0/3
A and B
A= @t == 1B= Net::DRI::Util::isa_contact($t[0], "Net::DRI::Data::Contact::AFNIC")
| |||||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | $t[0]->validate_registrant(); | |||||||||||||||||||||||||||||||||||||||||
| 103 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('Registrant contact must have an id') unless length $t[0]->srid(); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | return ['frnic:registrant',$t[0]->srid()]; | |||||||||||||||||||||||||||||||||||||||||
| 105 | } | ||||||||||||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||||||||||||
| 107 | sub build_cltrid | ||||||||||||||||||||||||||||||||||||||||||
| 108 | { | ||||||||||||||||||||||||||||||||||||||||||
| 109 | 0 | ▶ | my ($mes)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
build_cltrid: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 110 | 0 | return (['frnic:clTRID',$mes->cltrid()]); | |||||||||||||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||||||||||
| 113 | sub verify_contacts | ||||||||||||||||||||||||||||||||||||||||||
| 114 | { | ||||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | ▶ | my $rd=shift; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
verify_contacts: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('AFNIC needs contacts for domain operations') unless Net::DRI::Util::has_contact($rd); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | my @t=$rd->{contact}->get('admin'); | |||||||||||||||||||||||||||||||||||||||||
| 118 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('AFNIC needs one contact of type admin, and only one') unless (@t==1 && Net::DRI::Util::isa_contact($t[0],'Net::DRI::Data::Contact::AFNIC')); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@t == 1 and Net::DRI::Util::isa_contact($t[0], "Net::DRI::Data::Contact::AFNIC")
MC/DC0%0/2
@t == 1 and Net::DRI::Util::isa_contact($t[0], "Net::DRI::Data::Contact::AFNIC")
@t == 1
Net::DRI::Util::isa_contact($t[0], "Net::DRI::Data::Contact::AFNIC")
Truth table0%0/3
A and B
A= @t == 1B= Net::DRI::Util::isa_contact($t[0], "Net::DRI::Data::Contact::AFNIC")
| |||||||||||||||||||||||||||||||||||||||||||
| 119 | 0 | @t=grep { Net::DRI::Util::isa_contact($_,'Net::DRI::Data::Contact::AFNIC') } $rd->{contact}->get('tech'); | |||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('AFNIC needs one to three contacts of type tech') unless (@t >= 1 && @t <= 3); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@t >= 1 and @t <= 3
MC/DC0%0/2
@t >= 1 and @t <= 3
@t >= 1
@t <= 3
Truth table0%0/3
A and B
A= @t >= 1B= @t <= 3
| |||||||||||||||||||||||||||||||||||||||||||
| 121 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 122 | } | ||||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||
| 124 | sub build_contacts | ||||||||||||||||||||||||||||||||||||||||||
| 125 | { | ||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | ▶ | my ($rd)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
build_contacts: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | my $cs=$rd->{contact}; | |||||||||||||||||||||||||||||||||||||||||
| 128 | 0 | my @n; | |||||||||||||||||||||||||||||||||||||||||
| 129 | 0 | push @n,['frnic:contact',{type => 'admin'},$cs->get('admin')->srid()]; ## only one admin allowed | |||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | push @n,map { ['frnic:contact',{type => 'tech'},$_->srid()] } $cs->get('tech'); ## 1 to 3 allowed | |||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | return @n; | |||||||||||||||||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||||||||||
| 134 | sub build_authinfo | ||||||||||||||||||||||||||||||||||||||||||
| 135 | { | ||||||||||||||||||||||||||||||||||||||||||
| 136 | 0 | ▶ | my ($mes, $rd, $what)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
build_authinfo: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('authInfo is mandatory for a "'.$what.'"') unless (Net::DRI::Util::has_auth($rd) && exists($rd->{auth}->{pw}) && $rd->{auth}->{pw}); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
Net::DRI::Util::has_auth($rd) and exists $rd->{"auth"}{"pw"} and $rd->{"auth"}{"pw"}
Net::DRI::Util::has_auth($rd) and exists $rd->{"auth"}{"pw"}
MC/DC0%0/3
Net::DRI::Util::has_auth($rd) and exists $rd->{"auth"}{"pw"} and $rd->{"auth"}{"pw"}
Net::DRI::Util::has_auth($rd)
exists $rd->{"auth"}{"pw"}
$rd->{"auth"}{"pw"}
Truth table0%0/4
A and B and C
A= Net::DRI::Util::has_auth($rd)B= exists $rd->{"auth"}{"pw"}C= $rd->{"auth"}{"pw"}
| |||||||||||||||||||||||||||||||||||||||||||
| 138 | 0 | return ['frnic:authInfo',['domain:pw',{'xmlns:domain'=>$mes->ns('domain')},$rd->{auth}->{pw}]]; | |||||||||||||||||||||||||||||||||||||||||
| 139 | } | ||||||||||||||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||||||||||||||
| 141 | sub create | ||||||||||||||||||||||||||||||||||||||||||
| 142 | { | ||||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | ▶ | my ($epp,$domain,$rd)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 144 | 0 | my $mes=$epp->message(); | |||||||||||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||||||||||||
| 146 | ## We just make sure that we have all contact data | ||||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | verify_contacts($rd); | |||||||||||||||||||||||||||||||||||||||||
| 148 | 0 | build_registrant($rd); | |||||||||||||||||||||||||||||||||||||||||
| 149 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 150 | } | ||||||||||||||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||||||||||||||
| 152 | sub update | ||||||||||||||||||||||||||||||||||||||||||
| 153 | { | ||||||||||||||||||||||||||||||||||||||||||
| 154 | 0 | ▶ | my ($epp,$domain,$todo)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
update: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 155 | 0 | my $mes=$epp->message(); | |||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||
| 157 | ## We just verify that if we do a redemption, we only use op=request, because RFC3915 allows also op=report | ||||||||||||||||||||||||||||||||||||||||||
| 158 | 0 | my $rgp=$todo->set('rgp'); | |||||||||||||||||||||||||||||||||||||||||
| 159 | 0 | ▶ | return unless (defined($rgp) && $rgp && (ref($rgp) eq 'HASH')); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
defined $rgp and $rgp and ref $rgp eq "HASH"
defined $rgp and $rgp
MC/DC0%0/3
defined $rgp and $rgp and ref $rgp eq "HASH"
defined $rgp
$rgp
ref $rgp eq "HASH"
Truth table0%0/4
A and B and C
A= defined $rgpB= $rgpC= ref $rgp eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||
| 160 | 0 | ▶ | my $op=$rgp->{op} || ''; | ||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$rgp->{'op'} || ''
MC/DC0%0/1
$rgp->{'op'} || ''
$rgp->{'op'}
Truth table0%0/2
A
A= $rgp->{'op'}
| |||||||||||||||||||||||||||||||||||||||||||
| 161 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('RGP op can only be request for AFNIC') unless ($op eq 'request'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 162 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||||||||||||||||
| 165 | sub add_keepds | ||||||||||||||||||||||||||||||||||||||||||
| 166 | { | ||||||||||||||||||||||||||||||||||||||||||
| 167 | 0 | ▶ | my ($op,$rd)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_keepds: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 168 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('Domain "'.$op.'" operation needs a keep_ds attribute') unless Net::DRI::Util::has_key($rd,'keep_ds'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 169 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('keep_ds attribute must be boolean, not '.$rd->{keep_ds}) unless Net::DRI::Util::xml_is_boolean($rd->{keep_ds}); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||||||||||||
| 171 | 0 | return { 'keepDS' => $rd->{keep_ds} }; | |||||||||||||||||||||||||||||||||||||||||
| 172 | } | ||||||||||||||||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||||||||||||||||
| 174 | sub transfer_request | ||||||||||||||||||||||||||||||||||||||||||
| 175 | { | ||||||||||||||||||||||||||||||||||||||||||
| 176 | 0 | ▶ | my ($epp,$domain,$rd)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
transfer_request: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 177 | 0 | my $mes=$epp->message(); | |||||||||||||||||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | verify_contacts($rd); | |||||||||||||||||||||||||||||||||||||||||
| 180 | 0 | my $eid=$mes->command_extension_register('frnic', 'ext'); | |||||||||||||||||||||||||||||||||||||||||
| 181 | 0 | $mes->command_extension($eid,['frnic:transfer',['frnic:domain',add_keepds('transfer',$rd),build_contacts($rd)]]); | |||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 183 | } | ||||||||||||||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||||||||||||
| 185 | sub parse_trade_recover | ||||||||||||||||||||||||||||||||||||||||||
| 186 | { | ||||||||||||||||||||||||||||||||||||||||||
| 187 | 0 | ▶ | my ($po,$otype,$oaction,$oname,$rinfo,$s)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse_trade_recover: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 188 | 0 | my $mes=$po->message(); | |||||||||||||||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||||||||||||||||
| 190 | 0 | my $infdata=$mes->get_extension('frnic','ext'); | |||||||||||||||||||||||||||||||||||||||||
| 191 | 0 | ▶ | return unless defined $infdata; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||||||||
| 193 | 0 | my $ns=$mes->ns('frnic'); | |||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | $infdata=Net::DRI::Util::xml_traverse($infdata,$ns,'resData',$s,'domain'); | |||||||||||||||||||||||||||||||||||||||||
| 195 | 0 | ▶ | return unless defined $infdata; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||||||||||||||||
| 197 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($infdata)) | |||||||||||||||||||||||||||||||||||||||||
| 198 | { | ||||||||||||||||||||||||||||||||||||||||||
| 199 | 0 | my ($name,$c)=@$el; | |||||||||||||||||||||||||||||||||||||||||
| 200 | 0 | ▶ | if ($name eq 'name') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 201 | { | ||||||||||||||||||||||||||||||||||||||||||
| 202 | 0 | $oname=lc($c->textContent()); | |||||||||||||||||||||||||||||||||||||||||
| 203 | 0 | $rinfo->{domain}->{$oname}->{action}=$oaction; | |||||||||||||||||||||||||||||||||||||||||
| 204 | 0 | $rinfo->{domain}->{$oname}->{exist}=1; | |||||||||||||||||||||||||||||||||||||||||
| 205 | } elsif ($name eq 'trStatus') | ||||||||||||||||||||||||||||||||||||||||||
| 206 | { | ||||||||||||||||||||||||||||||||||||||||||
| 207 | 0 | $rinfo->{domain}->{$oname}->{$name}=$c->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 208 | } elsif ($name=~m/^(reID|reHldID|acID|acHldID)$/) | ||||||||||||||||||||||||||||||||||||||||||
| 209 | { | ||||||||||||||||||||||||||||||||||||||||||
| 210 | 0 | $rinfo->{domain}->{$oname}->{$name}=$c->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 211 | } elsif ($name=~m/^(reDate|rhDate|ahDate)$/) | ||||||||||||||||||||||||||||||||||||||||||
| 212 | { | ||||||||||||||||||||||||||||||||||||||||||
| 213 | 0 | $rinfo->{domain}->{$oname}->{$name}=$po->parse_iso8601($c->textContent()); | |||||||||||||||||||||||||||||||||||||||||
| 214 | } | ||||||||||||||||||||||||||||||||||||||||||
| 215 | } | ||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 217 | } | ||||||||||||||||||||||||||||||||||||||||||
| 218 | |||||||||||||||||||||||||||||||||||||||||||
| 219 | sub trade_request | ||||||||||||||||||||||||||||||||||||||||||
| 220 | { | ||||||||||||||||||||||||||||||||||||||||||
| 221 | 0 | ▶ | my ($epp,$domain,$rd)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
trade_request: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 222 | 0 | my $mes=$epp->message(); | |||||||||||||||||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||||||||||||||||
| 224 | 0 | my $eid=$mes->command_extension_register('frnic', 'ext'); | |||||||||||||||||||||||||||||||||||||||||
| 225 | 0 | my @n=build_domain($domain); | |||||||||||||||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||||||||||||||||
| 227 | 0 | push @n,build_registrant($rd); | |||||||||||||||||||||||||||||||||||||||||
| 228 | 0 | push @n,build_authinfo($mes, $rd, 'trade request'); | |||||||||||||||||||||||||||||||||||||||||
| 229 | 0 | $mes->command_extension($eid,['frnic:command',['frnic:trade',{op=>'request'},['frnic:domain',@n]],build_cltrid($mes)]); | |||||||||||||||||||||||||||||||||||||||||
| 230 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 231 | } | ||||||||||||||||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||||||||||||||
| 233 | sub trade_query | ||||||||||||||||||||||||||||||||||||||||||
| 234 | { | ||||||||||||||||||||||||||||||||||||||||||
| 235 | 0 | ▶ | my ($epp,$domain,$rd)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
trade_query: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 236 | 0 | my $mes=$epp->message(); | |||||||||||||||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||||||||||||||||
| 238 | 0 | my $eid=$mes->command_extension_register('frnic', 'ext'); | |||||||||||||||||||||||||||||||||||||||||
| 239 | 0 | my @n=build_domain($domain); | |||||||||||||||||||||||||||||||||||||||||
| 240 | 0 | push @n,build_authinfo($mes, $rd, 'trade query'); | |||||||||||||||||||||||||||||||||||||||||
| 241 | 0 | $mes->command_extension($eid,['frnic:command',['frnic:trade',{op=>'query'},['frnic:domain',@n]],build_cltrid($mes)]); | |||||||||||||||||||||||||||||||||||||||||
| 242 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 243 | } | ||||||||||||||||||||||||||||||||||||||||||
| 244 | |||||||||||||||||||||||||||||||||||||||||||
| 245 | sub trade_cancel | ||||||||||||||||||||||||||||||||||||||||||
| 246 | { | ||||||||||||||||||||||||||||||||||||||||||
| 247 | 0 | ▶ | my ($epp,$domain,$rd)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
trade_cancel: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 248 | 0 | my $mes=$epp->message(); | |||||||||||||||||||||||||||||||||||||||||
| 249 | |||||||||||||||||||||||||||||||||||||||||||
| 250 | 0 | my $eid=$mes->command_extension_register('frnic', 'ext'); | |||||||||||||||||||||||||||||||||||||||||
| 251 | 0 | my @n=build_domain($domain); | |||||||||||||||||||||||||||||||||||||||||
| 252 | 0 | push @n,build_authinfo($mes, $rd, 'trade cancel'); | |||||||||||||||||||||||||||||||||||||||||
| 253 | 0 | $mes->command_extension($eid,['frnic:command',['frnic:trade',{op=>'cancel'},['frnic:domain',@n]],build_cltrid($mes)]); | |||||||||||||||||||||||||||||||||||||||||
| 254 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 255 | } | ||||||||||||||||||||||||||||||||||||||||||
| 256 | |||||||||||||||||||||||||||||||||||||||||||
| 257 | sub trade_parse | ||||||||||||||||||||||||||||||||||||||||||
| 258 | { | ||||||||||||||||||||||||||||||||||||||||||
| 259 | 0 | ▶ | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
trade_parse: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 260 | 0 | my $mes=$po->message(); | |||||||||||||||||||||||||||||||||||||||||
| 261 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 262 | |||||||||||||||||||||||||||||||||||||||||||
| 263 | 0 | parse_trade_recover($po,$otype,'trade',$oname,$rinfo,'trdData'); | |||||||||||||||||||||||||||||||||||||||||
| 264 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 265 | } | ||||||||||||||||||||||||||||||||||||||||||
| 266 | |||||||||||||||||||||||||||||||||||||||||||
| 267 | sub recover_request | ||||||||||||||||||||||||||||||||||||||||||
| 268 | { | ||||||||||||||||||||||||||||||||||||||||||
| 269 | 0 | ▶ | my ($epp,$domain,$rd)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
recover_request: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 270 | 0 | my $mes=$epp->message(); | |||||||||||||||||||||||||||||||||||||||||
| 271 | |||||||||||||||||||||||||||||||||||||||||||
| 272 | 0 | my $eid=$mes->command_extension_register('frnic', 'ext'); | |||||||||||||||||||||||||||||||||||||||||
| 273 | 0 | my @n=build_domain($domain); | |||||||||||||||||||||||||||||||||||||||||
| 274 | 0 | push @n,build_authinfo($mes, $rd, 'recover request'); | |||||||||||||||||||||||||||||||||||||||||
| 275 | 0 | push @n,build_registrant($rd); | |||||||||||||||||||||||||||||||||||||||||
| 276 | 0 | push @n,build_contacts($rd); | |||||||||||||||||||||||||||||||||||||||||
| 277 | 0 | $mes->command_extension($eid,['frnic:command',['frnic:recover',{op=>'request'},['frnic:domain',add_keepds('recover',$rd),@n]],build_cltrid($mes)]); | |||||||||||||||||||||||||||||||||||||||||
| 278 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 279 | } | ||||||||||||||||||||||||||||||||||||||||||
| 280 | |||||||||||||||||||||||||||||||||||||||||||
| 281 | sub recover_parse | ||||||||||||||||||||||||||||||||||||||||||
| 282 | { | ||||||||||||||||||||||||||||||||||||||||||
| 283 | 0 | ▶ | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
recover_parse: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 284 | 0 | my $mes=$po->message(); | |||||||||||||||||||||||||||||||||||||||||
| 285 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 286 | |||||||||||||||||||||||||||||||||||||||||||
| 287 | 0 | parse_trade_recover($po,$otype,'recover',$oname,$rinfo,'recData'); | |||||||||||||||||||||||||||||||||||||||||
| 288 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 289 | } | ||||||||||||||||||||||||||||||||||||||||||
| 290 | |||||||||||||||||||||||||||||||||||||||||||
| 291 | sub check_parse | ||||||||||||||||||||||||||||||||||||||||||
| 292 | { | ||||||||||||||||||||||||||||||||||||||||||
| 293 | 0 | ▶ | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
check_parse: not called CC=11 SCAR=48.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 294 | 0 | my $mes=$po->message(); | |||||||||||||||||||||||||||||||||||||||||
| 295 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 296 | |||||||||||||||||||||||||||||||||||||||||||
| 297 | 0 | my $chkdata=$mes->get_extension('frnic','ext'); | |||||||||||||||||||||||||||||||||||||||||
| 298 | 0 | ▶ | return unless defined $chkdata; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 299 | |||||||||||||||||||||||||||||||||||||||||||
| 300 | 0 | my $ns=$mes->ns('frnic'); | |||||||||||||||||||||||||||||||||||||||||
| 301 | 0 | $chkdata=Net::DRI::Util::xml_traverse($chkdata,$ns,'resData','chkData','domain'); | |||||||||||||||||||||||||||||||||||||||||
| 302 | 0 | ▶ | return unless defined $chkdata; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 303 | |||||||||||||||||||||||||||||||||||||||||||
| 304 | 0 | foreach my $cd ($chkdata->getChildrenByTagNameNS($ns,'cd')) | |||||||||||||||||||||||||||||||||||||||||
| 305 | { | ||||||||||||||||||||||||||||||||||||||||||
| 306 | 0 | my (@r,@f,$domain); | |||||||||||||||||||||||||||||||||||||||||
| 307 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($cd)) | |||||||||||||||||||||||||||||||||||||||||
| 308 | { | ||||||||||||||||||||||||||||||||||||||||||
| 309 | 0 | my ($n,$c)=@$el; | |||||||||||||||||||||||||||||||||||||||||
| 310 | 0 | ▶ | if ($n eq 'name') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 311 | { | ||||||||||||||||||||||||||||||||||||||||||
| 312 | 0 | $domain=lc($c->textContent()); | |||||||||||||||||||||||||||||||||||||||||
| 313 | 0 | $rinfo->{domain}->{$domain}->{action}='check'; | |||||||||||||||||||||||||||||||||||||||||
| 314 | 0 | $rinfo->{domain}->{$domain}->{reserved}=Net::DRI::Util::xml_parse_boolean($c->getAttribute('reserved')); | |||||||||||||||||||||||||||||||||||||||||
| 315 | 0 | $rinfo->{domain}->{$domain}->{forbidden}=Net::DRI::Util::xml_parse_boolean($c->getAttribute('forbidden')); | |||||||||||||||||||||||||||||||||||||||||
| 316 | } elsif ($n eq 'rsvReason') | ||||||||||||||||||||||||||||||||||||||||||
| 317 | { | ||||||||||||||||||||||||||||||||||||||||||
| 318 | 0 | push @r,$c->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 319 | } elsif ($n eq 'fbdReason') | ||||||||||||||||||||||||||||||||||||||||||
| 320 | { | ||||||||||||||||||||||||||||||||||||||||||
| 321 | 0 | push @f,$c->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 322 | } | ||||||||||||||||||||||||||||||||||||||||||
| 323 | } | ||||||||||||||||||||||||||||||||||||||||||
| 324 | |||||||||||||||||||||||||||||||||||||||||||
| 325 | ## There may be multiple of them ! | ||||||||||||||||||||||||||||||||||||||||||
| 326 | 0 | ▶ | $rinfo->{domain}->{$domain}->{reserved_reason}=join("\n",@r) if @r; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 327 | 0 | ▶ | $rinfo->{domain}->{$domain}->{forbidden_reason}=join("\n",@f) if @f; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 328 | } | ||||||||||||||||||||||||||||||||||||||||||
| 329 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 330 | } | ||||||||||||||||||||||||||||||||||||||||||
| 331 | |||||||||||||||||||||||||||||||||||||||||||
| 332 | sub info_parse | ||||||||||||||||||||||||||||||||||||||||||
| 333 | { | ||||||||||||||||||||||||||||||||||||||||||
| 334 | 0 | ▶ | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
info_parse: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 335 | 0 | my $mes=$po->message(); | |||||||||||||||||||||||||||||||||||||||||
| 336 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 337 | |||||||||||||||||||||||||||||||||||||||||||
| 338 | 0 | my $infdata=$mes->get_extension('frnic','ext'); | |||||||||||||||||||||||||||||||||||||||||
| 339 | 0 | ▶ | return unless defined $infdata; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 340 | |||||||||||||||||||||||||||||||||||||||||||
| 341 | 0 | my $ns=$mes->ns('frnic'); | |||||||||||||||||||||||||||||||||||||||||
| 342 | 0 | $infdata=Net::DRI::Util::xml_traverse($infdata,$ns,'resData','infData','domain'); | |||||||||||||||||||||||||||||||||||||||||
| 343 | 0 | ▶ | return unless defined $infdata; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 344 | |||||||||||||||||||||||||||||||||||||||||||
| 345 | 0 | my $cs=$rinfo->{domain}->{$oname}->{status}; ## a Net::DRI::Protocol::EPP::Extensions::AFNIC::Status object | |||||||||||||||||||||||||||||||||||||||||
| 346 | 0 | foreach my $el ($infdata->getChildrenByTagNameNS($ns,'status')) | |||||||||||||||||||||||||||||||||||||||||
| 347 | { | ||||||||||||||||||||||||||||||||||||||||||
| 348 | 0 | $cs->rem('ok'); | |||||||||||||||||||||||||||||||||||||||||
| 349 | 0 | $cs->add($el->getAttribute('s')); | |||||||||||||||||||||||||||||||||||||||||
| 350 | } | ||||||||||||||||||||||||||||||||||||||||||
| 351 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 352 | } | ||||||||||||||||||||||||||||||||||||||||||
| 353 | |||||||||||||||||||||||||||||||||||||||||||
| 354 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 355 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||