| 1 | ## Domain Registry Interface, .CAT Domain EPP extension commands | ||||||||||||||||||||||||||||||||||||||||||
| 2 | ## | ||||||||||||||||||||||||||||||||||||||||||
| 3 | ## Copyright (c) 2006-2008,2012-2014,2016 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::CAT::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 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | 1 | ▶ | use Email::Valid; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 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::CAT::Domain - .CAT EPP Domain extension commands 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) 2006-2008,2012-2014,2016 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 | my %tmp=( | |||||||||||||||||||||||||||||||||||||||||
| 70 | create => [ \&create, undef ], | ||||||||||||||||||||||||||||||||||||||||||
| 71 | update => [ \&update, undef ], | ||||||||||||||||||||||||||||||||||||||||||
| 72 | info => [ undef, \&info_parse ], | ||||||||||||||||||||||||||||||||||||||||||
| 73 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||
| 75 | 0 | return { 'domain' => \%tmp }; | |||||||||||||||||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||
| 78 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||
| 80 | sub add_name_variant | ||||||||||||||||||||||||||||||||||||||||||
| 81 | { | ||||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | ▶ | my ($d)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_name_variant: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 83 | 0 | my @n; | |||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | ▶ | foreach my $n ((ref($d) eq 'ARRAY')? @{$d} : ($d)) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 86 | { | ||||||||||||||||||||||||||||||||||||||||||
| 87 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters($n.' in name_variant attribute must be an XML token between 1 & 255 chars in length') unless Net::DRI::Util::xml_is_token($n,1,255); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | push @n,['dx:nameVariant',$n]; | |||||||||||||||||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||||||||||||||||
| 91 | 0 | return @n; | |||||||||||||||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||
| 94 | sub add_lang | ||||||||||||||||||||||||||||||||||||||||||
| 95 | { | ||||||||||||||||||||||||||||||||||||||||||
| 96 | 0 | ▶ | my ($d)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_lang: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 97 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('lang attribute must be an XML language') unless (($d eq '') || Net::DRI::Util::xml_is_language($d)); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$d eq "" or Net::DRI::Util::xml_is_language($d)
MC/DC0%0/2
$d eq "" or Net::DRI::Util::xml_is_language($d)
$d eq ""
Net::DRI::Util::xml_is_language($d)
Truth table0%0/3
A or B
A= $d eq ""B= Net::DRI::Util::xml_is_language($d)
| |||||||||||||||||||||||||||||||||||||||||||
| 98 | 0 | return ['dx:language',$d]; | |||||||||||||||||||||||||||||||||||||||||
| 99 | } | ||||||||||||||||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||||||||||||||||
| 101 | sub add_maintainer | ||||||||||||||||||||||||||||||||||||||||||
| 102 | { | ||||||||||||||||||||||||||||||||||||||||||
| 103 | 0 | ▶ | my ($d)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_maintainer: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('maintainer attribute must be an XML token not more than 128 chars long') unless Net::DRI::Util::xml_is_token($d,undef,128); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | return ['dx:maintainer',$d]; | |||||||||||||||||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||
| 108 | sub add_intended_use | ||||||||||||||||||||||||||||||||||||||||||
| 109 | { | ||||||||||||||||||||||||||||||||||||||||||
| 110 | 0 | ▶ | my ($d)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_intended_use: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 111 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('intended_use must be a string between 1 and 1000 chars long') unless (''.$d && (length $d <= 1000)); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
'' . $d and length $d <= 1000
MC/DC0%0/2
'' . $d and length $d <= 1000
'' . $d
length $d <= 1000
Truth table0%0/3
A and B
A= '' . $dB= length $d <= 1000
| |||||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | return ['dx:intendedUse',$d]; | |||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||
| 115 | sub add_disclose | ||||||||||||||||||||||||||||||||||||||||||
| 116 | { | ||||||||||||||||||||||||||||||||||||||||||
| 117 | 0 | ▶ | my ($rd)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_disclose: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 118 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('registrant_disclosure must be a ref hash') unless ref $rd eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 119 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('registrant_disclosure must have a type key') unless exists $rd->{type}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('registrant_disclosure type key must have value "natural" or "legal"') unless $rd->{type}=~m/^(?:natural|legal)$/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 121 | 0 | ▶ | if ($rd->{type} eq 'natural') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 122 | { | ||||||||||||||||||||||||||||||||||||||||||
| 123 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('registrant_disclosure must have a disclose key when type=natural') unless exists $rd->{disclose}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 124 | 0 | ▶ | return ['dx:disclosure',['dx:natural',{disclose => $rd->{disclose} ? 'true' : 'false' }]]; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 125 | } else | ||||||||||||||||||||||||||||||||||||||||||
| 126 | { | ||||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | return ['dx:disclosure',['dx:legal']]; | |||||||||||||||||||||||||||||||||||||||||
| 128 | } | ||||||||||||||||||||||||||||||||||||||||||
| 129 | } | ||||||||||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||||||||||
| 131 | sub add_puntcat_extension | ||||||||||||||||||||||||||||||||||||||||||
| 132 | { | ||||||||||||||||||||||||||||||||||||||||||
| 133 | 0 | ▶ | my ($rd)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_puntcat_extension: not called CC=40 SCAR=74.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 134 | 0 | my @n; | |||||||||||||||||||||||||||||||||||||||||
| 135 | 0 | ▶ | return @n unless (defined $rd && ref $rd eq 'HASH' && keys %$rd); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
defined $rd and ref $rd eq "HASH" and keys %$rd
defined $rd and ref $rd eq "HASH"
MC/DC0%0/3
defined $rd and ref $rd eq "HASH" and keys %$rd
defined $rd
ref $rd eq "HASH"
keys %$rd
Truth table0%0/4
A and B and C
A= defined $rdB= ref $rd eq "HASH"C= keys %$rd
| |||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | ▶ | if (exists $rd->{name_variant} && defined $rd->{name_variant}) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
exists $rd->{"name_variant"} and defined $rd->{"name_variant"}
MC/DC0%0/2
exists $rd->{"name_variant"} and defined $rd->{"name_variant"}
exists $rd->{"name_variant"}
defined $rd->{"name_variant"}
Truth table0%0/3
A and B
A= exists $rd->{"name_variant"}B= defined $rd->{"name_variant"}
| |||||||||||||||||||||||||||||||||||||||||||
| 138 | { | ||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | push @n,add_name_variant($rd->{name_variant}); | |||||||||||||||||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||
| 142 | 0 | ▶ | push @n,add_lang($rd->{lang}) if (exists $rd->{lang} && defined $rd->{lang}); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
exists $rd->{"lang"} and defined $rd->{"lang"}
MC/DC0%0/2
exists $rd->{"lang"} and defined $rd->{"lang"}
exists $rd->{"lang"}
defined $rd->{"lang"}
Truth table0%0/3
A and B
A= exists $rd->{"lang"}B= defined $rd->{"lang"}
| |||||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | ▶ | push @n,add_maintainer($rd->{maintainer}) if (exists $rd->{maintainer} && defined $rd->{maintainer}); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
exists $rd->{"maintainer"} and defined $rd->{"maintainer"}
MC/DC0%0/2
exists $rd->{"maintainer"} and defined $rd->{"maintainer"}
exists $rd->{"maintainer"}
defined $rd->{"maintainer"}
Truth table0%0/3
A and B
A= exists $rd->{"maintainer"}B= defined $rd->{"maintainer"}
| |||||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||
| 145 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('ens block is mandatory, since intendeduse are mandatory') unless (exists $rd->{ens} && defined $rd->{ens} && (ref $rd->{ens} eq 'HASH')); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
exists $rd->{"ens"} and defined $rd->{"ens"} and ref $rd->{"ens"} eq "HASH"
exists $rd->{"ens"} and defined $rd->{"ens"}
MC/DC0%0/3
exists $rd->{"ens"} and defined $rd->{"ens"} and ref $rd->{"ens"} eq "HASH"
exists $rd->{"ens"}
defined $rd->{"ens"}
ref $rd->{"ens"} eq "HASH"
Truth table0%0/4
A and B and C
A= exists $rd->{"ens"}B= defined $rd->{"ens"}C= ref $rd->{"ens"} eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||
| 146 | 0 | my %ens=%{$rd->{ens}}; | |||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | my @ens; | |||||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||||
| 149 | 0 | ▶ | if (exists $ens{auth} && defined $ens{auth}) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
exists $ens{"auth"} and defined $ens{"auth"}
MC/DC0%0/2
exists $ens{"auth"} and defined $ens{"auth"}
exists $ens{"auth"}
defined $ens{"auth"}
Truth table0%0/3
A and B
A= exists $ens{"auth"}B= defined $ens{"auth"}
| |||||||||||||||||||||||||||||||||||||||||||
| 150 | { | ||||||||||||||||||||||||||||||||||||||||||
| 151 | 0 | ▶ | my %auth=(ref $ens{auth} eq 'HASH')? (key => $ens{auth}->{key}, id => $ens{auth}->{id} ) : (id => $ens{auth}); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 152 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('in ens auth block, id is mandatory') unless (exists $auth{id} && defined $auth{id}); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
exists $auth{"id"} and defined $auth{"id"}
MC/DC0%0/2
exists $auth{"id"} and defined $auth{"id"}
exists $auth{"id"}
defined $auth{"id"}
Truth table0%0/3
A and B
A= exists $auth{"id"}B= defined $auth{"id"}
| |||||||||||||||||||||||||||||||||||||||||||
| 153 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('id in ens auth block must be XML token between 1 and 20 chars long') if !Net::DRI::Util::xml_is_token($auth{id},1,20); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 154 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('key in ens auth block must be XML token between 1 and 20 chars long') if (exists $auth{key} && !Net::DRI::Util::xml_is_token($auth{key},1,20)); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
exists $auth{"key"} and not Net::DRI::Util::xml_is_token($auth{"key"}, 1, 20)
MC/DC0%0/2
exists $auth{"key"} and not Net::DRI::Util::xml_is_token($auth{"key"}, 1, 20)
exists $auth{"key"}
not Net::DRI::Util::xml_is_token($auth{"key"}, 1, 20)
Truth table0%0/3
A and not(B)
A= exists $auth{"key"}B= not Net::DRI::Util::xml_is_token($auth{"key"}, 1, 20)
| |||||||||||||||||||||||||||||||||||||||||||
| 155 | 0 | push @ens,['dx:auth',\%auth]; | |||||||||||||||||||||||||||||||||||||||||
| 156 | } | ||||||||||||||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||||||||||||||
| 158 | 0 | ▶ | if (exists $ens{sponsor} && defined $ens{sponsor}) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
exists $ens{"sponsor"} and defined $ens{"sponsor"}
MC/DC0%0/2
exists $ens{"sponsor"} and defined $ens{"sponsor"}
exists $ens{"sponsor"}
defined $ens{"sponsor"}
Truth table0%0/3
A and B
A= exists $ens{"sponsor"}B= defined $ens{"sponsor"}
| |||||||||||||||||||||||||||||||||||||||||||
| 159 | { | ||||||||||||||||||||||||||||||||||||||||||
| 160 | 0 | my @e; | |||||||||||||||||||||||||||||||||||||||||
| 161 | 0 | ▶ | foreach my $e ((ref $ens{sponsor} eq 'ARRAY')? @{$ens{sponsor}} : ($ens{sponsor})) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 162 | { | ||||||||||||||||||||||||||||||||||||||||||
| 163 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters("sponsor value $e in ens block must be a valid email address") unless (defined($e) && Net::DRI::Util::xml_is_token($e,1,undef) && Email::Valid->rfc822($e)); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
defined $e and Net::DRI::Util::xml_is_token($e, 1, undef) and "Email::Valid"->rfc822($e)
defined $e and Net::DRI::Util::xml_is_token($e, 1, undef)
MC/DC0%0/3
defined $e and Net::DRI::Util::xml_is_token($e, 1, undef) and "Email::Valid"->rfc822($e)
defined $e
Net::DRI::Util::xml_is_token($e, 1, undef)
"Email::Valid"->rfc822($e)
Truth table0%0/4
A and B and C
A= defined $eB= Net::DRI::Util::xml_is_token($e, 1, undef)C= "Email::Valid"->rfc822($e)
| |||||||||||||||||||||||||||||||||||||||||||
| 164 | 0 | push @e,['dx:sponsor',$e]; | |||||||||||||||||||||||||||||||||||||||||
| 165 | } | ||||||||||||||||||||||||||||||||||||||||||
| 166 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('there must be either 1 or 3 sponsors') unless (@e==1 || @e==3); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@e == 1 or @e == 3
MC/DC0%0/2
@e == 1 or @e == 3
@e == 1
@e == 3
Truth table0%0/3
A or B
A= @e == 1B= @e == 3
| |||||||||||||||||||||||||||||||||||||||||||
| 167 | 0 | push @ens,['dx:sponsoring',@e]; | |||||||||||||||||||||||||||||||||||||||||
| 168 | } | ||||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||
| 170 | 0 | ▶ | if (exists $ens{ref_url} && defined $ens{ref_url}) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
exists $ens{"ref_url"} and defined $ens{"ref_url"}
MC/DC0%0/2
exists $ens{"ref_url"} and defined $ens{"ref_url"}
exists $ens{"ref_url"}
defined $ens{"ref_url"}
Truth table0%0/3
A and B
A= exists $ens{"ref_url"}B= defined $ens{"ref_url"}
| |||||||||||||||||||||||||||||||||||||||||||
| 171 | { | ||||||||||||||||||||||||||||||||||||||||||
| 172 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('ref_url in ens auth block must be XML token between 1 and 255 chars long') unless Net::DRI::Util::xml_is_token($ens{ref_url},1,255); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 173 | 0 | push @ens,['dx:refURL',$ens{ref_url}]; | |||||||||||||||||||||||||||||||||||||||||
| 174 | } | ||||||||||||||||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||||||||||||||||
| 176 | 0 | ▶ | if (exists $ens{registration_type} && defined $ens{registration_type}) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
exists $ens{"registration_type"} and defined $ens{"registration_type"}
MC/DC0%0/2
exists $ens{"registration_type"} and defined $ens{"registration_type"}
exists $ens{"registration_type"}
defined $ens{"registration_type"}
Truth table0%0/3
A and B
A= exists $ens{"registration_type"}B= defined $ens{"registration_type"}
| |||||||||||||||||||||||||||||||||||||||||||
| 177 | { | ||||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('registration_type in ens auth block must be XML token between 1 and 128 chars long') unless Net::DRI::Util::xml_is_token($ens{registration_type},1,128); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | push @ens,['dx:registrationType',$ens{registration_type}]; | |||||||||||||||||||||||||||||||||||||||||
| 180 | } | ||||||||||||||||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('intended_use in ens auth block is mandatory') unless (exists $ens{intended_use} && defined $ens{intended_use}); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
exists $ens{"intended_use"} and defined $ens{"intended_use"}
MC/DC0%0/2
exists $ens{"intended_use"} and defined $ens{"intended_use"}
exists $ens{"intended_use"}
defined $ens{"intended_use"}
Truth table0%0/3
A and B
A= exists $ens{"intended_use"}B= defined $ens{"intended_use"}
| |||||||||||||||||||||||||||||||||||||||||||
| 183 | 0 | push @ens,add_intended_use($ens{intended_use}); | |||||||||||||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||||||||||||
| 185 | 0 | ▶ | push @n,['dx:ens',@ens] if @ens; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||||||||||
| 187 | 0 | ▶ | push @n,add_disclose($rd->{registrant_disclosure}) if Net::DRI::Util::has_key($rd,'registrant_disclosure'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 188 | 0 | return @n; | |||||||||||||||||||||||||||||||||||||||||
| 189 | } | ||||||||||||||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||||||||||||
| 191 | sub create | ||||||||||||||||||||||||||||||||||||||||||
| 192 | { | ||||||||||||||||||||||||||||||||||||||||||
| 193 | 0 | ▶ | my ($epp,$domain,$rd)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
create: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | my $mes=$epp->message(); | |||||||||||||||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||||||||||||||||
| 196 | 0 | my @n=add_puntcat_extension($rd); | |||||||||||||||||||||||||||||||||||||||||
| 197 | 0 | ▶ | return unless @n; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||||||||||||||||
| 199 | 0 | my $eid=$mes->command_extension_register('dx', 'create'); | |||||||||||||||||||||||||||||||||||||||||
| 200 | 0 | $mes->command_extension($eid,\@n); | |||||||||||||||||||||||||||||||||||||||||
| 201 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 202 | } | ||||||||||||||||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||||||||||||||||
| 204 | sub update | ||||||||||||||||||||||||||||||||||||||||||
| 205 | { | ||||||||||||||||||||||||||||||||||||||||||
| 206 | 0 | ▶ | my ($epp,$domain,$todo)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
update: not called CC=15 SCAR=54.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 207 | 0 | my $mes=$epp->message(); | |||||||||||||||||||||||||||||||||||||||||
| 208 | 0 | my (@tmp,@n); | |||||||||||||||||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||||||||||||||||||
| 210 | 0 | ▶ | if ($todo->types('name_variant')) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 211 | { | ||||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | ▶ | Net::DRI::Exception->die(0,'protocol/EPP',11,'Only name_variant add/del available for domain') if grep { ! /^(?:add|del)$/ } $todo->types('name_variant'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||||||||||||||||
| 214 | 0 | @tmp=add_name_variant($todo->add('name_variant')); | |||||||||||||||||||||||||||||||||||||||||
| 215 | 0 | ▶ | push @n,['dx:add',@tmp] if @tmp; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | @tmp=add_name_variant($todo->del('name_variant')); | |||||||||||||||||||||||||||||||||||||||||
| 217 | 0 | ▶ | push @n,['dx:rem',@tmp] if @tmp; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 218 | } | ||||||||||||||||||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | @tmp=(); | |||||||||||||||||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||||||||||||||||||
| 222 | 0 | ▶ | if ($todo->types('lang')) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 223 | { | ||||||||||||||||||||||||||||||||||||||||||
| 224 | 0 | ▶ | Net::DRI::Exception->die(0,'protocol/EPP',11,'Only lang set available for domain') if grep { $_ ne 'set' } $todo->types('lang'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 225 | 0 | push @tmp,add_lang($todo->set('lang')); | |||||||||||||||||||||||||||||||||||||||||
| 226 | } | ||||||||||||||||||||||||||||||||||||||||||
| 227 | 0 | ▶ | if ($todo->types('maintainer')) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 228 | { | ||||||||||||||||||||||||||||||||||||||||||
| 229 | 0 | ▶ | Net::DRI::Exception->die(0,'protocol/EPP',11,'Only maintainer set available for domain') if grep { $_ ne 'set' } $todo->types('maintainer'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 230 | 0 | push @tmp,add_maintainer($todo->set('maintainer')); | |||||||||||||||||||||||||||||||||||||||||
| 231 | } | ||||||||||||||||||||||||||||||||||||||||||
| 232 | 0 | ▶ | if ($todo->types('intended_use')) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 233 | { | ||||||||||||||||||||||||||||||||||||||||||
| 234 | 0 | ▶ | Net::DRI::Exception->die(0,'protocol/EPP',11,'Only intended_use set available for domain') if grep { $_ ne 'set' } $todo->types('intended_use'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 235 | 0 | push @tmp,add_intended_use($todo->set('intended_use')); | |||||||||||||||||||||||||||||||||||||||||
| 236 | } | ||||||||||||||||||||||||||||||||||||||||||
| 237 | 0 | ▶ | if ($todo->types('registrant_disclosure')) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 238 | { | ||||||||||||||||||||||||||||||||||||||||||
| 239 | 0 | ▶ | Net::DRI::Exception->die(0,'protocol/EPP',11,'Only registrant_disclosure set available for domain') if grep { $_ ne 'set' } $todo->types('registrant_disclosure'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 240 | 0 | push @tmp,add_disclose($todo->set('registrant_disclosure')); | |||||||||||||||||||||||||||||||||||||||||
| 241 | } | ||||||||||||||||||||||||||||||||||||||||||
| 242 | 0 | ▶ | push @n,['dx:chg',@tmp] if @tmp; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 243 | |||||||||||||||||||||||||||||||||||||||||||
| 244 | 0 | ▶ | return unless @n; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 245 | 0 | my $eid=$mes->command_extension_register('dx', 'update'); | |||||||||||||||||||||||||||||||||||||||||
| 246 | 0 | $mes->command_extension($eid,\@n); | |||||||||||||||||||||||||||||||||||||||||
| 247 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 248 | } | ||||||||||||||||||||||||||||||||||||||||||
| 249 | |||||||||||||||||||||||||||||||||||||||||||
| 250 | sub info_parse | ||||||||||||||||||||||||||||||||||||||||||
| 251 | { | ||||||||||||||||||||||||||||||||||||||||||
| 252 | 0 | ▶ | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
info_parse: not called CC=16 SCAR=56.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 253 | 0 | my $mes=$po->message(); | |||||||||||||||||||||||||||||||||||||||||
| 254 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 255 | |||||||||||||||||||||||||||||||||||||||||||
| 256 | 0 | my $infdata=$mes->get_extension('dx','infData'); | |||||||||||||||||||||||||||||||||||||||||
| 257 | 0 | ▶ | return unless $infdata; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 258 | |||||||||||||||||||||||||||||||||||||||||||
| 259 | 0 | my $ns=$mes->ns('dx'); | |||||||||||||||||||||||||||||||||||||||||
| 260 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($infdata)) | |||||||||||||||||||||||||||||||||||||||||
| 261 | { | ||||||||||||||||||||||||||||||||||||||||||
| 262 | 0 | my ($name,$c)=@$el; | |||||||||||||||||||||||||||||||||||||||||
| 263 | 0 | ▶ | if ($name eq 'nameVariant') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 5 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 264 | { | ||||||||||||||||||||||||||||||||||||||||||
| 265 | 0 | push @{$rinfo->{domain}->{$oname}->{name_variant}},$c->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 266 | } elsif ($name eq 'language') | ||||||||||||||||||||||||||||||||||||||||||
| 267 | { | ||||||||||||||||||||||||||||||||||||||||||
| 268 | 0 | $rinfo->{domain}->{$oname}->{lang}=$c->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 269 | } elsif ($name eq 'maintainer') | ||||||||||||||||||||||||||||||||||||||||||
| 270 | { | ||||||||||||||||||||||||||||||||||||||||||
| 271 | 0 | $rinfo->{domain}->{$oname}->{maintainer}=$c->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 272 | } elsif ($name eq 'ens') | ||||||||||||||||||||||||||||||||||||||||||
| 273 | { | ||||||||||||||||||||||||||||||||||||||||||
| 274 | 0 | my %ens; | |||||||||||||||||||||||||||||||||||||||||
| 275 | 0 | foreach my $ell (Net::DRI::Util::xml_list_children($c)) | |||||||||||||||||||||||||||||||||||||||||
| 276 | { | ||||||||||||||||||||||||||||||||||||||||||
| 277 | 0 | my ($name2,$cc)=@$ell; | |||||||||||||||||||||||||||||||||||||||||
| 278 | 0 | ▶ | if ($name2 eq 'auth') | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 5 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 279 | { | ||||||||||||||||||||||||||||||||||||||||||
| 280 | 0 | $ens{auth}={ id => $cc->getAttribute('id') }; | |||||||||||||||||||||||||||||||||||||||||
| 281 | } elsif ($name2 eq 'sponsoring') | ||||||||||||||||||||||||||||||||||||||||||
| 282 | { | ||||||||||||||||||||||||||||||||||||||||||
| 283 | 0 | $ens{sponsor}=[ map { $_->textContent() } $cc->getChildrenByTagNameNS($ns,'sponsor') ]; | |||||||||||||||||||||||||||||||||||||||||
| 284 | } elsif ($name2 eq 'refURL') | ||||||||||||||||||||||||||||||||||||||||||
| 285 | { | ||||||||||||||||||||||||||||||||||||||||||
| 286 | 0 | $ens{ref_url}=$cc->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 287 | } elsif ($name2 eq 'registrationType') | ||||||||||||||||||||||||||||||||||||||||||
| 288 | { | ||||||||||||||||||||||||||||||||||||||||||
| 289 | 0 | $ens{registration_type}=$cc->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 290 | } elsif ($name2 eq 'intendedUse') | ||||||||||||||||||||||||||||||||||||||||||
| 291 | { | ||||||||||||||||||||||||||||||||||||||||||
| 292 | 0 | $ens{intended_use}=$cc->textContent(); | |||||||||||||||||||||||||||||||||||||||||
| 293 | } | ||||||||||||||||||||||||||||||||||||||||||
| 294 | } | ||||||||||||||||||||||||||||||||||||||||||
| 295 | 0 | $rinfo->{domain}->{$oname}->{ens}=\%ens; | |||||||||||||||||||||||||||||||||||||||||
| 296 | } elsif ($name eq 'disclosure') | ||||||||||||||||||||||||||||||||||||||||||
| 297 | { | ||||||||||||||||||||||||||||||||||||||||||
| 298 | 0 | my @d=@{(Net::DRI::Util::xml_list_children($c))[0]}; | |||||||||||||||||||||||||||||||||||||||||
| 299 | 0 | my %e; | |||||||||||||||||||||||||||||||||||||||||
| 300 | 0 | $e{type}=$d[0]; ## natural or legal | |||||||||||||||||||||||||||||||||||||||||
| 301 | 0 | ▶ | $e{disclose}=Net::DRI::Util::xml_parse_boolean($d[1]->getAttribute('disclose')) if ($e{type} eq 'natural'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 302 | 0 | $rinfo->{domain}->{$oname}->{registrant_disclosure}=\%e; | |||||||||||||||||||||||||||||||||||||||||
| 303 | } | ||||||||||||||||||||||||||||||||||||||||||
| 304 | } | ||||||||||||||||||||||||||||||||||||||||||
| 305 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 306 | } | ||||||||||||||||||||||||||||||||||||||||||
| 307 | |||||||||||||||||||||||||||||||||||||||||||
| 308 | #################################################################################################### | ||||||||||||||||||||||||||||||||||||||||||
| 309 | 1 | 1; | |||||||||||||||||||||||||||||||||||||||||