« DRI/Protocol/EPP/Extensions/ICANN/RegistrarExpirationDate.pm
↑ Summary
DRI/Protocol/ResultStatus.pm »
| 1 | ## Domain Registry Interface, Nomulus Superuser Extension Mapping for EPP | ||||||||||||||||||||||||||||
| 2 | ## | ||||||||||||||||||||||||||||
| 3 | ## Copyright (c) 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::Nomulus::Superuser; | ||||||||||||||||||||||||||||
| 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 | |||||||||||||||||||||||||||||
| 23 | #################################################################################################### | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | sub register_commands | ||||||||||||||||||||||||||||
| 26 | { | ||||||||||||||||||||||||||||
| 27 | 0 | ▶ | my ($class,$version)=@_; | ||||||||||||||||||||||||||
|
Subroutine
register_commands: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 28 | 0 | state $cmds = { 'domain' => { delete => [ \&delete, undef ] , 'transfer_request' => [ \&transfer, undef] } }; | |||||||||||||||||||||||||||
| 29 | 0 | return $cmds; | |||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | sub setup | ||||||||||||||||||||||||||||
| 33 | { | ||||||||||||||||||||||||||||
| 34 | 0 | ▶ | my ($class,$po,$version)=@_; | ||||||||||||||||||||||||||
|
Subroutine
setup: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 35 | 0 | state $ns = { 'superuser' => 'urn:google:params:xml:ns:superuser-1.0' }; | |||||||||||||||||||||||||||
| 36 | 0 | $po->ns($ns); | |||||||||||||||||||||||||||
| 37 | 0 | return; | |||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 0 | ▶ | sub implements { return 'https://github.com/google/nomulus/blob/4b83615513a7fafd6bbab6a0b65d1726dede1f7a/java/google/registry/xml/xsd/superuser.xsd'; } | ||||||||||||||||||||||||||
|
Subroutine
implements: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | #################################################################################################### | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | sub delete ## no critic (Subroutines::ProhibitBuiltinHomonyms) | ||||||||||||||||||||||||||||
| 45 | { | ||||||||||||||||||||||||||||
| 46 | 0 | ▶ | my ($epp,$domain,$rd)=@_; | ||||||||||||||||||||||||||
|
Subroutine
delete: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | 0 | ▶ | return unless Net::DRI::Util::has_key($rd, 'superuser') && ref $rd->{'superuser'} eq 'HASH'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
Net::DRI::Util::has_key($rd, "superuser") and ref $rd->{"superuser"} eq "HASH"
MC/DC0%0/2
Net::DRI::Util::has_key($rd, "superuser") and ref $rd->{"superuser"} eq "HASH"
Net::DRI::Util::has_key($rd, "superuser")
ref $rd->{"superuser"} eq "HASH"
Truth table0%0/3
A and B
A= Net::DRI::Util::has_key($rd, "superuser")B= ref $rd->{"superuser"} eq "HASH"
| |||||||||||||||||||||||||||||
| 49 | 0 | my $superuser = $rd->{superuser}; | |||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('redemption_grace_period must be defined') unless Net::DRI::Util::has_key($superuser, 'redemption_grace_period'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 52 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('redemption_grace_period must be of type XML nonNegativeInteger') unless Net::DRI::Util::is_class($superuser->{redemption_grace_period}, 'DateTime::Duration'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 53 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('pending_delete must be defined') unless Net::DRI::Util::has_key($superuser, 'pending_delete'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 54 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('pending_delete must be of type XML nonNegativeInteger') unless Net::DRI::Util::is_class($superuser->{pending_delete}, 'DateTime::Duration'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | my @data=(['superuser:redemptionGracePeriodDays', $superuser->{redemption_grace_period}->in_units('days')], | ||||||||||||||||||||||||||||
| 57 | 0 | ['superuser:pendingDeleteDays', $superuser->{pending_delete}->in_units('days')]); | |||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | 0 | my $mes=$epp->message(); | |||||||||||||||||||||||||||
| 60 | 0 | my $eid=$mes->command_extension_register('superuser', 'domainDelete'); | |||||||||||||||||||||||||||
| 61 | 0 | $mes->command_extension($eid, \@data); | |||||||||||||||||||||||||||
| 62 | 0 | return; | |||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | sub transfer | ||||||||||||||||||||||||||||
| 66 | { | ||||||||||||||||||||||||||||
| 67 | 0 | ▶ | my ($epp,$domain,$rd)=@_; | ||||||||||||||||||||||||||
|
Subroutine
transfer: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||
| 69 | 0 | ▶ | return unless Net::DRI::Util::has_key($rd, 'superuser') && ref $rd->{'superuser'} eq 'HASH'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
Net::DRI::Util::has_key($rd, "superuser") and ref $rd->{"superuser"} eq "HASH"
MC/DC0%0/2
Net::DRI::Util::has_key($rd, "superuser") and ref $rd->{"superuser"} eq "HASH"
Net::DRI::Util::has_key($rd, "superuser")
ref $rd->{"superuser"} eq "HASH"
Truth table0%0/3
A and B
A= Net::DRI::Util::has_key($rd, "superuser")B= ref $rd->{"superuser"} eq "HASH"
| |||||||||||||||||||||||||||||
| 70 | 0 | my $superuser = $rd->{superuser}; | |||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('duration must be defined') unless Net::DRI::Util::has_key($superuser, 'duration'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 73 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('duration must be a DateTime::Duration object') unless Net::DRI::Util::is_class($superuser->{duration}, 'DateTime::Duration'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 74 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('transfer_length must be defined') unless Net::DRI::Util::has_key($superuser, 'transfer_length'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 75 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('transfer_length must be of type XML nonNegativeInteger') unless Net::DRI::Util::verify_int($superuser->{transfer_length}, 0); # this does not get until infinity, but should be good enough | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | 0 | my $period=Net::DRI::Protocol::EPP::Util::build_period($superuser->{duration}); | |||||||||||||||||||||||||||
| 78 | 0 | $period->[0] = 'superuser:renewalPeriod'; # using "period" like in core EPP would have been too simple... | |||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||
| 80 | 0 | my @data=($period, ['superuser:automaticTransferLength', $superuser->{transfer_length}]); | |||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | 0 | my $mes=$epp->message(); | |||||||||||||||||||||||||||
| 83 | 0 | my $eid=$mes->command_extension_register('superuser', 'domainTransferRequest'); | |||||||||||||||||||||||||||
| 84 | 0 | $mes->command_extension($eid, \@data); | |||||||||||||||||||||||||||
| 85 | 0 | return; | |||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | #################################################################################################### | ||||||||||||||||||||||||||||
| 89 | 1 | 1; | |||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||
| 91 | __END__ | ||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||
| 93 | =pod | ||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||
| 95 | =head1 NAME | ||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||
| 97 | Net::DRI::Protocol::EPP::Extensions::Nomulus::Superuser - EPP Superuser Nomulus Extension mapping for Net::DRI | ||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||
| 99 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||
| 101 | Please see the README file for details. | ||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||
| 103 | =head1 SUPPORT | ||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||
| 105 | For now, support questions should be sent to: | ||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||
| 107 | E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||
| 109 | Please also see the SUPPORT file in the distribution. | ||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||
| 111 | =head1 SEE ALSO | ||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||
| 113 | E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt> | ||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||
| 115 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||
| 117 | Patrick Mevzek, E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||
| 119 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||
| 121 | Copyright (c) 2017-2018 Patrick Mevzek <netdri@dotandco.com>. | ||||||||||||||||||||||||||||
| 122 | All rights reserved. | ||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||
| 124 | This program is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||
| 125 | it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||
| 126 | the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||||||||||
| 127 | (at your option) any later version. | ||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||
| 129 | See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||
| 131 | =cut | ||||||||||||||||||||||||||||