| 1 | ## EPP Mapping for CIRA Fury (Fury Platform Technical Test v1.3.pdf) | ||||||||||||||||||||||||||||||||
| 2 | ## | ||||||||||||||||||||||||||||||||
| 3 | ## Copyright (c) 2019 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::CIRA::Fury; | ||||||||||||||||||||||||||||||||
| 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 | #################################################################################################### | ||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||
| 26 | sub register_commands | ||||||||||||||||||||||||||||||||
| 27 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
register_commands: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 28 | 0 | my ($class,$version)=@_; | |||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||
| 30 | 0 | state $cmds = { | |||||||||||||||||||||||||||||||
| 31 | 'contact' => { | ||||||||||||||||||||||||||||||||
| 32 | 'create' => [ \&contact_create_build, undef ], | ||||||||||||||||||||||||||||||||
| 33 | 'info' => [ undef, \&contact_info_parse ], | ||||||||||||||||||||||||||||||||
| 34 | 'update' => [ \&contact_update_build, undef ], | ||||||||||||||||||||||||||||||||
| 35 | }, | ||||||||||||||||||||||||||||||||
| 36 | 'domain' => { | ||||||||||||||||||||||||||||||||
| 37 | 'create' => [ \&domain_create_build, undef ], | ||||||||||||||||||||||||||||||||
| 38 | 'info' => [ undef, \&domain_info_parse ], | ||||||||||||||||||||||||||||||||
| 39 | 'update' => [ \&domain_update_build, undef ], | ||||||||||||||||||||||||||||||||
| 40 | }, | ||||||||||||||||||||||||||||||||
| 41 | 'agreement' => { | ||||||||||||||||||||||||||||||||
| 42 | 'info' => [ \&agreement_info_build, \&agreement_info_parse ], | ||||||||||||||||||||||||||||||||
| 43 | }, | ||||||||||||||||||||||||||||||||
| 44 | }; | ||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||
| 46 | 0 | return $cmds; | |||||||||||||||||||||||||||||||
| 47 | } | ||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||
| 49 | 0 | ▶ | sub capabilities_add { return (['domain_update','privacy',['set']], ['contact_update', 'lang', ['add', 'del']]); } | ||||||||||||||||||||||||||||||
|
Subroutine
capabilities_add: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||
| 51 | sub setup | ||||||||||||||||||||||||||||||||
| 52 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
setup: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 53 | 0 | my ($class,$po,$version)=@_; | |||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||
| 55 | 0 | state $ns = { | |||||||||||||||||||||||||||||||
| 56 | 'fury' => 'urn:ietf:params:xml:ns:fury-2.0', | ||||||||||||||||||||||||||||||||
| 57 | 'fury-rgp' => 'urn:ietf:params:xml:ns:fury-rgp-1.0', | ||||||||||||||||||||||||||||||||
| 58 | }; | ||||||||||||||||||||||||||||||||
| 59 | 0 | $po->ns($ns); | |||||||||||||||||||||||||||||||
| 60 | 0 | return; | |||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||
| 63 | 0 | ▶ | sub implements { return 'Fury Platform Technical Test v1.3.pdf'; } | ||||||||||||||||||||||||||||||
|
Subroutine
implements: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||
| 65 | #################################################################################################### | ||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||
| 67 | sub build_properties | ||||||||||||||||||||||||||||||||
| 68 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
build_properties: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 69 | 0 | my ($rprops) = @_; | |||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||
| 71 | 0 | my @ps; | |||||||||||||||||||||||||||||||
| 72 | 0 | foreach my $key (sort(keys(%$rprops))) | |||||||||||||||||||||||||||||||
| 73 | { | ||||||||||||||||||||||||||||||||
| 74 | 0 | my @p; | |||||||||||||||||||||||||||||||
| 75 | 0 | push @p, ['fury:key', $key]; | |||||||||||||||||||||||||||||||
| 76 | 0 | my $value = $rprops->{$key}; | |||||||||||||||||||||||||||||||
| 77 | 0 | ▶ | if (not defined $value) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 78 | { | ||||||||||||||||||||||||||||||||
| 79 | 0 | push @p, ['fury:remAll', 'true']; | |||||||||||||||||||||||||||||||
| 80 | } else | ||||||||||||||||||||||||||||||||
| 81 | { | ||||||||||||||||||||||||||||||||
| 82 | 0 | ▶ | $value = [ $value ] unless ref $value eq 'ARRAY'; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 83 | 0 | my %attributes; | |||||||||||||||||||||||||||||||
| 84 | 0 | my $content = ''; | |||||||||||||||||||||||||||||||
| 85 | 0 | ▶ | foreach my $data (ref $value eq 'ARRAY' ? @$value : [$value]) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 86 | { | ||||||||||||||||||||||||||||||||
| 87 | 0 | ▶ | if (ref $data eq 'HASH') | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 88 | { | ||||||||||||||||||||||||||||||||
| 89 | 0 | %attributes = (%attributes, %$data); | |||||||||||||||||||||||||||||||
| 90 | } else | ||||||||||||||||||||||||||||||||
| 91 | { | ||||||||||||||||||||||||||||||||
| 92 | 0 | $content = $data; | |||||||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||||||
| 95 | 0 | push @p, ['fury:value', \%attributes, $content]; | |||||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||||||
| 97 | 0 | push @ps, ['fury:property', @p]; | |||||||||||||||||||||||||||||||
| 98 | } | ||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||
| 100 | 0 | return @ps; | |||||||||||||||||||||||||||||||
| 101 | } | ||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||
| 103 | sub parse_value | ||||||||||||||||||||||||||||||||
| 104 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
parse_value: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 105 | 0 | my ($po, $topnode) = @_; | |||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||
| 107 | 0 | my $value = $topnode->textContent(); | |||||||||||||||||||||||||||||||
| 108 | 0 | ▶ | if ($topnode->hasAttribute('remAll') && Net::DRI::Util::xml_parse_boolean($topnode->getAttribue('remAll'))) | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
$topnode->hasAttribute("remAll") and Net::DRI::Util::xml_parse_boolean($topnode->getAttribue("remAll"))
MC/DC0%0/2
$topnode->hasAttribute("remAll") and Net::DRI::Util::xml_parse_boolean($topnode->getAttribue("remAll"))
$topnode->hasAttribute("remAll")
Net::DRI::Util::xml_parse_boolean($topnode->getAttribue("remAll"))
Truth table0%0/3
A and B
A= $topnode->hasAttribute("remAll")B= Net::DRI::Util::xml_parse_boolean($topnode->getAttribue("remAll"))
| |||||||||||||||||||||||||||||||||
| 109 | { | ||||||||||||||||||||||||||||||||
| 110 | 0 | $value = undef; | |||||||||||||||||||||||||||||||
| 111 | } elsif ($topnode->hasAttribute('default')) | ||||||||||||||||||||||||||||||||
| 112 | { | ||||||||||||||||||||||||||||||||
| 113 | 0 | $value = [ $value, {'default' => $topnode->getAttribute('default')} ]; | |||||||||||||||||||||||||||||||
| 114 | } | ||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||
| 116 | 0 | return $value; | |||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||
| 119 | sub parse_property_value | ||||||||||||||||||||||||||||||||
| 120 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
parse_property_value: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 121 | 0 | my ($po, $topnode) = @_; | |||||||||||||||||||||||||||||||
| 122 | 0 | my %value; | |||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||
| 124 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($topnode)) | |||||||||||||||||||||||||||||||
| 125 | { | ||||||||||||||||||||||||||||||||
| 126 | 0 | my ($name, $node) = @$el; | |||||||||||||||||||||||||||||||
| 127 | 0 | ▶ | if ($name eq 'value') # only mandatory element | ||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||
| 128 | { | ||||||||||||||||||||||||||||||||
| 129 | 0 | $value{value} = parse_value($po, $node); | |||||||||||||||||||||||||||||||
| 130 | } elsif ($name eq 'localizedValue') | ||||||||||||||||||||||||||||||||
| 131 | { | ||||||||||||||||||||||||||||||||
| 132 | 0 | $value{localized_value} = $node->textContent(); | |||||||||||||||||||||||||||||||
| 133 | } elsif ($name eq 'localizedDetail') | ||||||||||||||||||||||||||||||||
| 134 | { | ||||||||||||||||||||||||||||||||
| 135 | 0 | $value{localized_detail} = $node->textContent(); | |||||||||||||||||||||||||||||||
| 136 | } elsif ($name eq 'propertyValueAttributes') | ||||||||||||||||||||||||||||||||
| 137 | { | ||||||||||||||||||||||||||||||||
| 138 | 0 | $value{attributes} = {}; | |||||||||||||||||||||||||||||||
| 139 | 0 | foreach my $ell (Net::DRI::Util::xml_list_children($node, 'propertyValueAttribute')) | |||||||||||||||||||||||||||||||
| 140 | { | ||||||||||||||||||||||||||||||||
| 141 | 0 | my ($key, $value) = parse_attribute($po, $ell); | |||||||||||||||||||||||||||||||
| 142 | 0 | $value{attributes}->{$key} = $value; | |||||||||||||||||||||||||||||||
| 143 | } | ||||||||||||||||||||||||||||||||
| 144 | 0 | ▶ | delete $value{attributes} unless %{$value{attributes}}; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 145 | } | ||||||||||||||||||||||||||||||||
| 146 | } | ||||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||||
| 148 | 0 | return \%value; | |||||||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||
| 151 | sub parse_attribute | ||||||||||||||||||||||||||||||||
| 152 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
parse_attribute: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 153 | 0 | my ($po, $topnode) = @_; | |||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||
| 155 | 0 | my ($key, $value); | |||||||||||||||||||||||||||||||
| 156 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($topnode)) | |||||||||||||||||||||||||||||||
| 157 | { | ||||||||||||||||||||||||||||||||
| 158 | 0 | my ($name, $node) = @$el; | |||||||||||||||||||||||||||||||
| 159 | 0 | ▶ | if ($name eq 'key') | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 160 | { | ||||||||||||||||||||||||||||||||
| 161 | 0 | $key = $node->textContent(); | |||||||||||||||||||||||||||||||
| 162 | } elsif ($name eq 'value') | ||||||||||||||||||||||||||||||||
| 163 | { | ||||||||||||||||||||||||||||||||
| 164 | 0 | $value = parse_value($po, $node); | |||||||||||||||||||||||||||||||
| 165 | } | ||||||||||||||||||||||||||||||||
| 166 | } | ||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||
| 168 | 0 | return ($key, $value); | |||||||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||||||
| 171 | sub parse_property | ||||||||||||||||||||||||||||||||
| 172 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
parse_property: not called CC=10 SCAR=47.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 173 | 0 | my ($po, $topnode) = @_; | |||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||
| 175 | 0 | my ($key, %value); | |||||||||||||||||||||||||||||||
| 176 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($topnode)) | |||||||||||||||||||||||||||||||
| 177 | { | ||||||||||||||||||||||||||||||||
| 178 | 0 | my ($name, $node) = @$el; | |||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||
| 180 | 0 | ▶ | if ($name eq 'key') | ||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||
| 181 | { | ||||||||||||||||||||||||||||||||
| 182 | 0 | $key = $node->textContent(); | |||||||||||||||||||||||||||||||
| 183 | } elsif ($name eq 'localizedKey') | ||||||||||||||||||||||||||||||||
| 184 | { | ||||||||||||||||||||||||||||||||
| 185 | 0 | $value{localized_key} = $node->textContent(); | |||||||||||||||||||||||||||||||
| 186 | } elsif ($name eq 'propertyValues') | ||||||||||||||||||||||||||||||||
| 187 | { | ||||||||||||||||||||||||||||||||
| 188 | 0 | $value{'values'} = []; | |||||||||||||||||||||||||||||||
| 189 | 0 | foreach my $ell (Net::DRI::Util::xml_list_children($node, 'propertyValue')) | |||||||||||||||||||||||||||||||
| 190 | { | ||||||||||||||||||||||||||||||||
| 191 | 0 | push @{$value{'values'}}, parse_property_value($po, $ell) | |||||||||||||||||||||||||||||||
| 192 | } | ||||||||||||||||||||||||||||||||
| 193 | 0 | ▶ | delete $value{'values'} unless @{$value{'values'}}; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 194 | } elsif ($name eq 'propertyAttributes') | ||||||||||||||||||||||||||||||||
| 195 | { | ||||||||||||||||||||||||||||||||
| 196 | 0 | $value{attributes} = {}; | |||||||||||||||||||||||||||||||
| 197 | 0 | foreach my $ell (Net::DRI::Util::xml_list_children($node, 'propertyAttribute')) | |||||||||||||||||||||||||||||||
| 198 | { | ||||||||||||||||||||||||||||||||
| 199 | 0 | my ($key, $value) = parse_attribute($po, $ell); | |||||||||||||||||||||||||||||||
| 200 | 0 | $value{attributes}->{$key} = $value; | |||||||||||||||||||||||||||||||
| 201 | } | ||||||||||||||||||||||||||||||||
| 202 | 0 | ▶ | delete $value{attributes} unless %{$value{attributes}}; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 203 | } | ||||||||||||||||||||||||||||||||
| 204 | } | ||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||
| 206 | 0 | return $key, \%value; | |||||||||||||||||||||||||||||||
| 207 | } | ||||||||||||||||||||||||||||||||
| 208 | |||||||||||||||||||||||||||||||||
| 209 | sub contact_create_build | ||||||||||||||||||||||||||||||||
| 210 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
contact_create_build: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 211 | 0 | my ($epp, $contact)=@_; | |||||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||||||
| 213 | ## $contact->validate() has been called | ||||||||||||||||||||||||||||||||
| 214 | 0 | my %props; | |||||||||||||||||||||||||||||||
| 215 | 0 | $props{'LANGUAGE'} = uc $contact->lang(); | |||||||||||||||||||||||||||||||
| 216 | 0 | ▶ | $props{'CPR'} = $contact->legal_form() if defined $contact->legal_form(); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||||||
| 218 | 0 | my $ra = $contact->agreement(); | |||||||||||||||||||||||||||||||
| 219 | 0 | ▶ | if (defined $ra and $ra->{signed}) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $ra and $ra->{"signed"}
MC/DC0%0/2
defined $ra and $ra->{"signed"}
defined $ra
$ra->{"signed"}
Truth table0%0/3
A and B
A= defined $raB= $ra->{"signed"}
| |||||||||||||||||||||||||||||||||
| 220 | { | ||||||||||||||||||||||||||||||||
| 221 | 0 | ▶ | $props{'AGREEMENT_VERSION'} = $ra->{version} eq 'default' ? {'default' => 'true'} : $ra->{version}; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 222 | } | ||||||||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||||||
| 224 | 0 | $epp->message()->command_extension('fury', ['create', ['properties', build_properties(\%props)]]); | |||||||||||||||||||||||||||||||
| 225 | 0 | return; | |||||||||||||||||||||||||||||||
| 226 | } | ||||||||||||||||||||||||||||||||
| 227 | |||||||||||||||||||||||||||||||||
| 228 | sub contact_info_parse | ||||||||||||||||||||||||||||||||
| 229 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
contact_info_parse: not called CC=11 SCAR=48.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 230 | 0 | my ($po, $otype, $oaction, $oname, $rinfo)=@_; | |||||||||||||||||||||||||||||||
| 231 | 0 | my $mes = $po->message(); | |||||||||||||||||||||||||||||||
| 232 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 233 | |||||||||||||||||||||||||||||||||
| 234 | 0 | my $infdata=$mes->get_extension('fury','info'); | |||||||||||||||||||||||||||||||
| 235 | 0 | ▶ | return unless defined $infdata; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||||||
| 237 | 0 | my $contact = $rinfo->{contact}->{$oname}->{self}; | |||||||||||||||||||||||||||||||
| 238 | |||||||||||||||||||||||||||||||||
| 239 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($infdata)) | |||||||||||||||||||||||||||||||
| 240 | { | ||||||||||||||||||||||||||||||||
| 241 | 0 | my ($name, $node) = @$el; | |||||||||||||||||||||||||||||||
| 242 | 0 | ▶ | if ($name eq 'properties') | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 243 | { | ||||||||||||||||||||||||||||||||
| 244 | 0 | my %agreement; | |||||||||||||||||||||||||||||||
| 245 | 0 | foreach my $ell (Net::DRI::Util::xml_list_children($node, 'property')) | |||||||||||||||||||||||||||||||
| 246 | { | ||||||||||||||||||||||||||||||||
| 247 | 0 | my ($key, $value) = parse_attribute($po, $ell); | |||||||||||||||||||||||||||||||
| 248 | 0 | ▶ | if (uc $key eq 'LANGUAGE') | ||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||
| 249 | { | ||||||||||||||||||||||||||||||||
| 250 | 0 | $contact->lang(lc $value); | |||||||||||||||||||||||||||||||
| 251 | } elsif (uc $key eq 'CPR') | ||||||||||||||||||||||||||||||||
| 252 | { | ||||||||||||||||||||||||||||||||
| 253 | 0 | $contact->legal_form($value); | |||||||||||||||||||||||||||||||
| 254 | } elsif (uc $key eq 'AGREEMENT_TIMESTAMP') | ||||||||||||||||||||||||||||||||
| 255 | { | ||||||||||||||||||||||||||||||||
| 256 | 0 | $agreement{timestamp} = $po->parse_iso8601($value); | |||||||||||||||||||||||||||||||
| 257 | } elsif (uc $key eq 'AGREEMENT_VERSION') | ||||||||||||||||||||||||||||||||
| 258 | { | ||||||||||||||||||||||||||||||||
| 259 | 0 | $agreement{version} = $value; | |||||||||||||||||||||||||||||||
| 260 | 0 | $agreement{signed} = 1; | |||||||||||||||||||||||||||||||
| 261 | } | ||||||||||||||||||||||||||||||||
| 262 | } | ||||||||||||||||||||||||||||||||
| 263 | 0 | ▶ | $contact->agreement(\%agreement) if %agreement; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 264 | } | ||||||||||||||||||||||||||||||||
| 265 | } | ||||||||||||||||||||||||||||||||
| 266 | |||||||||||||||||||||||||||||||||
| 267 | 0 | return; | |||||||||||||||||||||||||||||||
| 268 | } | ||||||||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||||||
| 270 | sub contact_update_build | ||||||||||||||||||||||||||||||||
| 271 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
contact_update_build: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 272 | 0 | my ($epp,$contact,$todo)=@_; | |||||||||||||||||||||||||||||||
| 273 | |||||||||||||||||||||||||||||||||
| 274 | 0 | my $add = $todo->add('lang'); | |||||||||||||||||||||||||||||||
| 275 | 0 | my $del = $todo->del('lang'); | |||||||||||||||||||||||||||||||
| 276 | 0 | ▶ | return unless defined $add && defined $del; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $add and defined $del
MC/DC0%0/2
defined $add and defined $del
defined $add
defined $del
Truth table0%0/3
A and B
A= defined $addB= defined $del
| |||||||||||||||||||||||||||||||||
| 277 | |||||||||||||||||||||||||||||||||
| 278 | 0 | my @d; | |||||||||||||||||||||||||||||||
| 279 | 0 | push @d, ['add', ['properties', build_properties({'LANGUAGE' => uc $add})]]; | |||||||||||||||||||||||||||||||
| 280 | 0 | push @d, ['rem', ['properties', build_properties({'LANGUAGE' => uc $del})]]; | |||||||||||||||||||||||||||||||
| 281 | # What about CPR and AGREEMENT? | ||||||||||||||||||||||||||||||||
| 282 | 0 | $epp->message()->command_extension('fury', ['update', @d]); | |||||||||||||||||||||||||||||||
| 283 | 0 | return; | |||||||||||||||||||||||||||||||
| 284 | } | ||||||||||||||||||||||||||||||||
| 285 | |||||||||||||||||||||||||||||||||
| 286 | |||||||||||||||||||||||||||||||||
| 287 | sub domain_create_build | ||||||||||||||||||||||||||||||||
| 288 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
domain_create_build: not called CC=9 SCAR=45.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 289 | 0 | my ($epp, $domain, $rd)=@_; | |||||||||||||||||||||||||||||||
| 290 | |||||||||||||||||||||||||||||||||
| 291 | 0 | my $privacy; | |||||||||||||||||||||||||||||||
| 292 | |||||||||||||||||||||||||||||||||
| 293 | # Backwards compatible way first, use data from registrant contact | ||||||||||||||||||||||||||||||||
| 294 | 0 | my $registrant = $rd->{contact}->get('registrant'); | |||||||||||||||||||||||||||||||
| 295 | 0 | ▶ | if ($registrant && Net::DRI::Util::isa_contact($registrant)) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$registrant and Net::DRI::Util::isa_contact($registrant)
MC/DC0%0/2
$registrant and Net::DRI::Util::isa_contact($registrant)
$registrant
Net::DRI::Util::isa_contact($registrant)
Truth table0%0/3
A and B
A= $registrantB= Net::DRI::Util::isa_contact($registrant)
| |||||||||||||||||||||||||||||||||
| 296 | { | ||||||||||||||||||||||||||||||||
| 297 | 0 | my $wd = $registrant->whois_display(); | |||||||||||||||||||||||||||||||
| 298 | 0 | ▶ | if (defined $wd) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 299 | { | ||||||||||||||||||||||||||||||||
| 300 | 0 | ▶ | if ($wd eq 'FULL') | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 301 | { | ||||||||||||||||||||||||||||||||
| 302 | 0 | $privacy = 0; | |||||||||||||||||||||||||||||||
| 303 | } elsif ($wd eq 'PRIVATE') | ||||||||||||||||||||||||||||||||
| 304 | { | ||||||||||||||||||||||||||||||||
| 305 | 0 | $privacy = 1; | |||||||||||||||||||||||||||||||
| 306 | } | ||||||||||||||||||||||||||||||||
| 307 | } | ||||||||||||||||||||||||||||||||
| 308 | } | ||||||||||||||||||||||||||||||||
| 309 | |||||||||||||||||||||||||||||||||
| 310 | 0 | ▶ | $privacy = $rd->{'privacy'} if Net::DRI::Util::has_key($rd, 'privacy'); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 311 | |||||||||||||||||||||||||||||||||
| 312 | 0 | ▶ | return unless $privacy; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 313 | |||||||||||||||||||||||||||||||||
| 314 | 0 | ▶ | my %props = ('PRIVACY' => $privacy ? 'PRIVATE' : 'PUBLIC'); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 315 | |||||||||||||||||||||||||||||||||
| 316 | 0 | $epp->message()->command_extension('fury', ['create', ['properties', build_properties(\%props)]]); | |||||||||||||||||||||||||||||||
| 317 | 0 | return; | |||||||||||||||||||||||||||||||
| 318 | } | ||||||||||||||||||||||||||||||||
| 319 | |||||||||||||||||||||||||||||||||
| 320 | sub domain_info_parse | ||||||||||||||||||||||||||||||||
| 321 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
domain_info_parse: not called CC=11 SCAR=48.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 322 | 0 | my ($po, $otype, $oaction, $oname, $rinfo)=@_; | |||||||||||||||||||||||||||||||
| 323 | 0 | my $mes = $po->message(); | |||||||||||||||||||||||||||||||
| 324 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 325 | |||||||||||||||||||||||||||||||||
| 326 | 0 | my $infdata1=$mes->get_extension('fury', 'info'); | |||||||||||||||||||||||||||||||
| 327 | 0 | ▶ | if ($infdata1) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 328 | { | ||||||||||||||||||||||||||||||||
| 329 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($infdata1)) | |||||||||||||||||||||||||||||||
| 330 | { | ||||||||||||||||||||||||||||||||
| 331 | 0 | my ($name, $node) = @$el; | |||||||||||||||||||||||||||||||
| 332 | 0 | ▶ | if ($name eq 'properties') | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 333 | { | ||||||||||||||||||||||||||||||||
| 334 | 0 | my %agreement; | |||||||||||||||||||||||||||||||
| 335 | 0 | foreach my $ell (Net::DRI::Util::xml_list_children($node, 'property')) | |||||||||||||||||||||||||||||||
| 336 | { | ||||||||||||||||||||||||||||||||
| 337 | 0 | my ($key, $value) = parse_attribute($po, $ell); | |||||||||||||||||||||||||||||||
| 338 | 0 | ▶ | if (uc $key eq 'PRIVACY') | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 339 | { | ||||||||||||||||||||||||||||||||
| 340 | 0 | ▶ | $rinfo->{domain}->{$oname}->{privacy} = uc $value eq 'PRIVATE' ? 1 : 0; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 341 | 0 | my $registrant = $rinfo->{domain}->{$oname}->{contact}->get('registrant'); | |||||||||||||||||||||||||||||||
| 342 | 0 | ▶ | $registrant->whois_display(uc $value eq 'PRIVATE' ? 'PRIVATE' : 'FULL'); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 343 | } | ||||||||||||||||||||||||||||||||
| 344 | } | ||||||||||||||||||||||||||||||||
| 345 | } elsif ($name eq 'bundle') | ||||||||||||||||||||||||||||||||
| 346 | { | ||||||||||||||||||||||||||||||||
| 347 | 0 | my @v = Net::DRI::Util::xml_list_children($node, 'name'); | |||||||||||||||||||||||||||||||
| 348 | 0 | push @v, Net::DRI::Util::xml_list_children((Net::DRI::Util::xml_list_children($node, 'domains'))[0], 'name'); | |||||||||||||||||||||||||||||||
| 349 | 0 | $rinfo->{domain}->{$oname}->{variants} = [ map { $_->textContent() } @v ]; | |||||||||||||||||||||||||||||||
| 350 | } | ||||||||||||||||||||||||||||||||
| 351 | } | ||||||||||||||||||||||||||||||||
| 352 | } | ||||||||||||||||||||||||||||||||
| 353 | |||||||||||||||||||||||||||||||||
| 354 | 0 | my $infdata2 = $mes->get_extension('fury-rgp', 'rgpInfo'); | |||||||||||||||||||||||||||||||
| 355 | 0 | ▶ | if ($infdata2) | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 356 | { | ||||||||||||||||||||||||||||||||
| 357 | 0 | my $date = (Net::DRI::Util::xml_list_children($infdata2, 'rgpStatusEnd'))[0]->textContent(); | |||||||||||||||||||||||||||||||
| 358 | 0 | $date =~ s/^\s+//; | |||||||||||||||||||||||||||||||
| 359 | 0 | $date =~ s/\s+$//; | |||||||||||||||||||||||||||||||
| 360 | 0 | $rinfo->{domain}->{$oname}->{rgp_status_end} = $po->parse_iso8601($date); | |||||||||||||||||||||||||||||||
| 361 | } | ||||||||||||||||||||||||||||||||
| 362 | |||||||||||||||||||||||||||||||||
| 363 | 0 | return; | |||||||||||||||||||||||||||||||
| 364 | } | ||||||||||||||||||||||||||||||||
| 365 | |||||||||||||||||||||||||||||||||
| 366 | sub domain_update_build | ||||||||||||||||||||||||||||||||
| 367 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
domain_update_build: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 368 | 0 | my ($epp, $domain, $todo)=@_; | |||||||||||||||||||||||||||||||
| 369 | |||||||||||||||||||||||||||||||||
| 370 | # since there is only the privacy attribute, and it is binary, | ||||||||||||||||||||||||||||||||
| 371 | # we can emulate the silly add+rem from registry by a simple and logical set | ||||||||||||||||||||||||||||||||
| 372 | 0 | my $toset = $todo->set('privacy'); | |||||||||||||||||||||||||||||||
| 373 | |||||||||||||||||||||||||||||||||
| 374 | 0 | ▶ | return unless defined $toset; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 375 | |||||||||||||||||||||||||||||||||
| 376 | 0 | my %on = ('PRIVACY' => 'PRIVATE'); | |||||||||||||||||||||||||||||||
| 377 | 0 | my %off = ('PRIVACY' => 'PUBLIC'); | |||||||||||||||||||||||||||||||
| 378 | |||||||||||||||||||||||||||||||||
| 379 | 0 | my @d; | |||||||||||||||||||||||||||||||
| 380 | 0 | ▶ | push @d, ['add', ['properties', build_properties($toset ? \%on : \%off)]]; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 381 | 0 | ▶ | push @d, ['rem', ['properties', build_properties($toset ? \%off : \%on)]]; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 382 | 0 | $epp->message()->command_extension('fury', ['update', @d]); | |||||||||||||||||||||||||||||||
| 383 | |||||||||||||||||||||||||||||||||
| 384 | 0 | return; | |||||||||||||||||||||||||||||||
| 385 | } | ||||||||||||||||||||||||||||||||
| 386 | |||||||||||||||||||||||||||||||||
| 387 | sub agreement_info_build | ||||||||||||||||||||||||||||||||
| 388 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
agreement_info_build: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 389 | 0 | my ($epp, $language) = @_; | |||||||||||||||||||||||||||||||
| 390 | |||||||||||||||||||||||||||||||||
| 391 | 0 | ▶ | $epp->message()->command_extension('fury', ['command', ['info', ['language', $language // 'en'], ['properties', build_properties({'AGREEMENT_VERSION' => {'default' => 'true'}})]]]); | ||||||||||||||||||||||||||||||
|
Condition0%0/2
$language // "en"
MC/DC0%0/1
$language // "en"
$language
Truth table0%0/2
A
A= $language
| |||||||||||||||||||||||||||||||||
| 392 | 0 | return; | |||||||||||||||||||||||||||||||
| 393 | } | ||||||||||||||||||||||||||||||||
| 394 | |||||||||||||||||||||||||||||||||
| 395 | sub agreement_info_parse | ||||||||||||||||||||||||||||||||
| 396 | 0 | ▶ | { | ||||||||||||||||||||||||||||||
|
Subroutine
agreement_info_parse: not called CC=9 SCAR=45.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 397 | 0 | my ($po, $otype, $oaction, $oname, $rinfo)=@_; | |||||||||||||||||||||||||||||||
| 398 | 0 | my $mes = $po->message(); | |||||||||||||||||||||||||||||||
| 399 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 400 | |||||||||||||||||||||||||||||||||
| 401 | 0 | my $infdata = $mes->get_extension('fury', 'response'); | |||||||||||||||||||||||||||||||
| 402 | 0 | ▶ | return unless defined $infdata; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 403 | |||||||||||||||||||||||||||||||||
| 404 | 0 | ($infdata) = Net::DRI::Util::xml_list_children($infdata, 'infData'); | |||||||||||||||||||||||||||||||
| 405 | 0 | ▶ | return unless defined $infdata; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 406 | |||||||||||||||||||||||||||||||||
| 407 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($infdata)) | |||||||||||||||||||||||||||||||
| 408 | { | ||||||||||||||||||||||||||||||||
| 409 | 0 | my ($name, $node) = @$el; | |||||||||||||||||||||||||||||||
| 410 | 0 | ▶ | if ($name eq 'language') | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||
| 411 | { | ||||||||||||||||||||||||||||||||
| 412 | 0 | $rinfo->{agreement}->{cira}->{language} = lc $node->textContent(); | |||||||||||||||||||||||||||||||
| 413 | } elsif ($name eq 'properties') | ||||||||||||||||||||||||||||||||
| 414 | { | ||||||||||||||||||||||||||||||||
| 415 | 0 | foreach my $ell (Net::DRI::Util::xml_list_children($node, 'property')) | |||||||||||||||||||||||||||||||
| 416 | { | ||||||||||||||||||||||||||||||||
| 417 | 0 | my ($key, $value) = parse_property($po, $ell); | |||||||||||||||||||||||||||||||
| 418 | |||||||||||||||||||||||||||||||||
| 419 | 0 | ▶ | if ($key eq 'AGREEMENT_VERSION') | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 420 | { | ||||||||||||||||||||||||||||||||
| 421 | 0 | $rinfo->{agreement}->{cira}->{version} = $value->{'values'}[0]{'localized_value'}; | |||||||||||||||||||||||||||||||
| 422 | 0 | $rinfo->{agreement}->{cira}->{content} = $value->{'values'}[0]{'localized_detail'}; | |||||||||||||||||||||||||||||||
| 423 | } | ||||||||||||||||||||||||||||||||
| 424 | } | ||||||||||||||||||||||||||||||||
| 425 | } | ||||||||||||||||||||||||||||||||
| 426 | } | ||||||||||||||||||||||||||||||||
| 427 | |||||||||||||||||||||||||||||||||
| 428 | 0 | return; | |||||||||||||||||||||||||||||||
| 429 | } | ||||||||||||||||||||||||||||||||
| 430 | |||||||||||||||||||||||||||||||||
| 431 | #################################################################################################### | ||||||||||||||||||||||||||||||||
| 432 | 1 | 1; | |||||||||||||||||||||||||||||||
| 433 | |||||||||||||||||||||||||||||||||
| 434 | __END__ | ||||||||||||||||||||||||||||||||