« DRI/Protocol/EPP/Extensions/Afilias/Message.pm
↑ Summary
DRI/Protocol/EPP/Extensions/AusRegistry/IDN.pm »
| 1 | ## Domain Registry Interface, SIDN EPP Domain extensions | ||||||||||||||||||||||||||||
| 2 | ## | ||||||||||||||||||||||||||||
| 3 | ## Copyright (c) 2009-2011,2013,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::SIDN::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 | #################################################################################################### | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | sub register_commands | ||||||||||||||||||||||||||||
| 27 | { | ||||||||||||||||||||||||||||
| 28 | 0 | ▶ | my ($class,$version)=@_; | ||||||||||||||||||||||||||
|
Subroutine
register_commands: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 29 | 0 | state $domain = { | |||||||||||||||||||||||||||
| 30 | info => [ undef, \&info_parse], | ||||||||||||||||||||||||||||
| 31 | create => [ \&create, undef ], | ||||||||||||||||||||||||||||
| 32 | delete_cancel => [ \&delete_cancel, undef ], | ||||||||||||||||||||||||||||
| 33 | transfer_request => [ undef, \&transfer_parse ], | ||||||||||||||||||||||||||||
| 34 | }; | ||||||||||||||||||||||||||||
| 35 | 0 | state $commands = { 'domain' => $domain }; | |||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 0 | return $commands; | |||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | #################################################################################################### | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | sub info_parse | ||||||||||||||||||||||||||||
| 43 | { | ||||||||||||||||||||||||||||
| 44 | 0 | ▶ | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | ||||||||||||||||||||||||||
|
Subroutine
info_parse: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||
| 45 | 0 | my $mes=$po->message(); | |||||||||||||||||||||||||||
| 46 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | 0 | my $infdata=$mes->get_extension('sidn','ext'); | |||||||||||||||||||||||||||
| 49 | 0 | ▶ | return unless defined $infdata; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | 0 | my $ns=$mes->ns('sidn'); | |||||||||||||||||||||||||||
| 52 | 0 | $infdata=Net::DRI::Util::xml_traverse($infdata,$ns,'infData','domain'); | |||||||||||||||||||||||||||
| 53 | 0 | ▶ | return unless defined $infdata; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($infdata)) | |||||||||||||||||||||||||||
| 56 | { | ||||||||||||||||||||||||||||
| 57 | 0 | my ($name,$c)=@$el; | |||||||||||||||||||||||||||
| 58 | 0 | ▶ | if ($name eq 'optOut') | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 59 | { | ||||||||||||||||||||||||||||
| 60 | 0 | $rinfo->{domain}->{$oname}->{opt_out}=Net::DRI::Util::xml_parse_boolean($c->textContent()); | |||||||||||||||||||||||||||
| 61 | } elsif ($name eq 'limited') | ||||||||||||||||||||||||||||
| 62 | { | ||||||||||||||||||||||||||||
| 63 | 0 | $rinfo->{domain}->{$oname}->{limited}=Net::DRI::Util::xml_parse_boolean($c->textContent()); | |||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||
| 66 | 0 | return; | |||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||
| 69 | sub create | ||||||||||||||||||||||||||||
| 70 | { | ||||||||||||||||||||||||||||
| 71 | 0 | ▶ | my ($epp,$domain,$rd)=@_; | ||||||||||||||||||||||||||
|
Subroutine
create: not called CC=8 SCAR=42.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 72 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('contacts are mandatory in .NL for domain_create') unless Net::DRI::Util::has_contact($rd); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 73 | 0 | my $cs=$rd->{contact}; | |||||||||||||||||||||||||||
| 74 | 0 | my @c=$cs->get('registrant'); | |||||||||||||||||||||||||||
| 75 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('one registrant is mandatory in .NL for domain_create') unless (@c==1 && Net::DRI::Util::isa_contact($c[0],'Net::DRI::Data::Contact::SIDN')); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@c == 1 and Net::DRI::Util::isa_contact($c[0], "Net::DRI::Data::Contact::SIDN")
MC/DC0%0/2
@c == 1 and Net::DRI::Util::isa_contact($c[0], "Net::DRI::Data::Contact::SIDN")
@c == 1
Net::DRI::Util::isa_contact($c[0], "Net::DRI::Data::Contact::SIDN")
Truth table0%0/3
A and B
A= @c == 1B= Net::DRI::Util::isa_contact($c[0], "Net::DRI::Data::Contact::SIDN")
| |||||||||||||||||||||||||||||
| 76 | 0 | @c=$cs->get('admin'); | |||||||||||||||||||||||||||
| 77 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('one admin contact is mandatory in .NL for domain_create') unless (@c==1 && Net::DRI::Util::isa_contact($c[0],'Net::DRI::Data::Contact::SIDN')); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@c == 1 and Net::DRI::Util::isa_contact($c[0], "Net::DRI::Data::Contact::SIDN")
MC/DC0%0/2
@c == 1 and Net::DRI::Util::isa_contact($c[0], "Net::DRI::Data::Contact::SIDN")
@c == 1
Net::DRI::Util::isa_contact($c[0], "Net::DRI::Data::Contact::SIDN")
Truth table0%0/3
A and B
A= @c == 1B= Net::DRI::Util::isa_contact($c[0], "Net::DRI::Data::Contact::SIDN")
| |||||||||||||||||||||||||||||
| 78 | 0 | @c=$cs->get('tech'); | |||||||||||||||||||||||||||
| 79 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('at least one tech contact is mandatory in .NL for domain_create') unless (@c >= 1 && scalar(@c)==scalar(grep { Net::DRI::Util::isa_contact($_,'Net::DRI::Data::Contact::SIDN') } @c)); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
@c >= 1 and scalar @c == scalar grep({Net::DRI::Util::isa_contact($_, "Net::DRI::Data::Contact::SIDN");} @c)
MC/DC0%0/2
@c >= 1 and scalar @c == scalar grep({Net::DRI::Util::isa_contact($_, "Net::DRI::Data::Contact::SIDN");} @c)
@c >= 1
scalar @c == scalar grep({Net::DRI::Util::isa_contact($_, "Net::DRI::Data::Contact::SIDN");} @c)
Truth table0%0/3
A and B
A= @c >= 1B= scalar @c == scalar grep({Net::DRI::Util::isa_contact($_, "Net::DRI::Data::Contact::SIDN");} @c)
| |||||||||||||||||||||||||||||
| 80 | 0 | return; | |||||||||||||||||||||||||||
| 81 | } | ||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||
| 83 | sub delete_cancel | ||||||||||||||||||||||||||||
| 84 | { | ||||||||||||||||||||||||||||
| 85 | 0 | ▶ | my ($epp,$domain,$rd)=@_; | ||||||||||||||||||||||||||
|
Subroutine
delete_cancel: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||
| 87 | 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
| |||||||||||||||||||||||||||||
| 88 | 0 | ▶ | Net::DRI::Exception->die(1,'protocol/EPP',10,'Invalid domain name: '.$domain) unless Net::DRI::Util::is_hostname($domain); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | 0 | my $mes=$epp->message(); | |||||||||||||||||||||||||||
| 91 | 0 | my $eid=$mes->command_extension_register('sidn', 'command'); | |||||||||||||||||||||||||||
| 92 | 0 | $mes->command_extension($eid,[['sidn:domainCancelDelete',['sidn:name',$domain]],['sidn:clTRID',$mes->cltrid()]]); | |||||||||||||||||||||||||||
| 93 | 0 | return; | |||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||
| 96 | sub transfer_parse | ||||||||||||||||||||||||||||
| 97 | { | ||||||||||||||||||||||||||||
| 98 | 0 | ▶ | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | ||||||||||||||||||||||||||
|
Subroutine
transfer_parse: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 99 | 0 | my $mes=$po->message(); | |||||||||||||||||||||||||||
| 100 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||
| 102 | 0 | my $trndata=$mes->get_response('sidn','ext'); | |||||||||||||||||||||||||||
| 103 | 0 | ▶ | return unless defined $trndata; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||
| 105 | 0 | my $ns=$mes->ns('sidn'); | |||||||||||||||||||||||||||
| 106 | 0 | my $pw=Net::DRI::Util::xml_traverse($trndata,$ns,'trnData','pw'); | |||||||||||||||||||||||||||
| 107 | 0 | ▶ | return unless defined $pw; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||
| 109 | 0 | $rinfo->{domain}->{$oname}->{transfer_new_token}=$pw->textContent(); | |||||||||||||||||||||||||||
| 110 | 0 | return; | |||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||
| 113 | #################################################################################################### | ||||||||||||||||||||||||||||
| 114 | 1 | 1; | |||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||
| 116 | __END__ | ||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||
| 118 | =pod | ||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||
| 120 | =head1 NAME | ||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||
| 122 | Net::DRI::Protocol::EPP::Extensions::SIDN::Domain - SIDN (.NL) EPP Domain extensions for Net::DRI | ||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||
| 124 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||
| 126 | Please see the README file for details. | ||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||
| 128 | =head1 SUPPORT | ||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||
| 130 | For now, support questions should be sent to: | ||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||
| 132 | E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||
| 134 | Please also see the SUPPORT file in the distribution. | ||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||
| 136 | =head1 SEE ALSO | ||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||
| 138 | E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt> | ||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||
| 140 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||
| 142 | Patrick Mevzek, E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||
| 144 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||
| 146 | Copyright (c) 2009-2011,2013,2016 Patrick Mevzek <netdri@dotandco.com>. | ||||||||||||||||||||||||||||
| 147 | All rights reserved. | ||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||
| 149 | This program is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||
| 150 | it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||
| 151 | the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||||||||||
| 152 | (at your option) any later version. | ||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||
| 154 | See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||
| 156 | =cut | ||||||||||||||||||||||||||||