« DRI/Protocol/EPP/Extensions/ICANN/MarkSignedMark.pm
↑ Summary
DRI/Protocol/EPP/Extensions/EURid/Sunrise.pm »
| 1 | ## Domain Registry Interface, Nomulus Allocate Extension Mapping for EPP | ||||||||||||||||||||||||||||
| 2 | ## | ||||||||||||||||||||||||||||
| 3 | ## Copyright (c) 2017-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::Allocate; | ||||||||||||||||||||||||||||
| 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 $cmds = { 'domain' => { create => [ \&build, undef ] } }; | |||||||||||||||||||||||||||
| 30 | 0 | return $cmds; | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | sub setup | ||||||||||||||||||||||||||||
| 34 | { | ||||||||||||||||||||||||||||
| 35 | 0 | ▶ | my ($class,$po,$version)=@_; | ||||||||||||||||||||||||||
|
Subroutine
setup: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 36 | 0 | state $ns = { 'allocate' => 'urn:google:params:xml:ns:allocate-1.0' }; | |||||||||||||||||||||||||||
| 37 | 0 | $po->ns($ns); | |||||||||||||||||||||||||||
| 38 | 0 | return; | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 0 | ▶ | sub implements { return 'https://github.com/google/nomulus/blob/5012893c1d761d60591f165a1c5640624b28df9d/java/google/registry/xml/xsd/allocate.xsd'; } | ||||||||||||||||||||||||||
|
Subroutine
implements: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | #################################################################################################### | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | sub build | ||||||||||||||||||||||||||||
| 46 | { | ||||||||||||||||||||||||||||
| 47 | 0 | ▶ | my ($epp,$domain,$rd)=@_; | ||||||||||||||||||||||||||
|
Subroutine
build: not called CC=17 SCAR=57.2
Pod
undocumented
| |||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | 0 | ▶ | return unless Net::DRI::Util::has_key($rd, 'allocate') && ref $rd->{'allocate'} eq 'HASH'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
Net::DRI::Util::has_key($rd, "allocate") and ref $rd->{"allocate"} eq "HASH"
MC/DC0%0/2
Net::DRI::Util::has_key($rd, "allocate") and ref $rd->{"allocate"} eq "HASH"
Net::DRI::Util::has_key($rd, "allocate")
ref $rd->{"allocate"} eq "HASH"
Truth table0%0/3
A and B
A= Net::DRI::Util::has_key($rd, "allocate")B= ref $rd->{"allocate"} eq "HASH"
| |||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||
| 51 | 0 | my $rh=$rd->{'allocate'}; | |||||||||||||||||||||||||||
| 52 | 0 | my @data; | |||||||||||||||||||||||||||
| 53 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters('allocate.roid must be defined') unless Net::DRI::Util::has_key($rh, 'roid') && Net::DRI::Util::is_roid($rh->{'roid'}); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
Net::DRI::Util::has_key($rh, "roid") and Net::DRI::Util::is_roid($rh->{"roid"})
MC/DC0%0/2
Net::DRI::Util::has_key($rh, "roid") and Net::DRI::Util::is_roid($rh->{"roid"})
Net::DRI::Util::has_key($rh, "roid")
Net::DRI::Util::is_roid($rh->{"roid"})
Truth table0%0/3
A and B
A= Net::DRI::Util::has_key($rh, "roid")B= Net::DRI::Util::is_roid($rh->{"roid"})
| |||||||||||||||||||||||||||||
| 54 | 0 | push @data, ['allocate:applicationRoid', $rh->{'roid'}]; | |||||||||||||||||||||||||||
| 55 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('allocate.application_time must be a DateTime object') unless Net::DRI::Util::has_key($rh, 'application_time') && Net::DRI::Util::check_isa($rh->{application_time}, 'DateTime'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
Net::DRI::Util::has_key($rh, "application_time") and Net::DRI::Util::check_isa($rh->{"application_time"}, "DateTime")
MC/DC0%0/2
Net::DRI::Util::has_key($rh, "application_time") and Net::DRI::Util::check_isa($rh->{"application_time"}, "DateTime")
Net::DRI::Util::has_key($rh, "application_time")
Net::DRI::Util::check_isa($rh->{"application_time"}, "DateTime")
Truth table0%0/3
A and B
A= Net::DRI::Util::has_key($rh, "application_time")B= Net::DRI::Util::check_isa($rh->{"application_time"}, "DateTime")
| |||||||||||||||||||||||||||||
| 56 | 0 | push @data, ['allocate:applicationTime', $rh->{application_time}->clone()->set_time_zone('UTC')->strftime('%Y-%m-%dT%H:%M:%SZ')]; | |||||||||||||||||||||||||||
| 57 | 0 | ▶ | if (Net::DRI::Util::has_key($rh, 'smd')) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 58 | { | ||||||||||||||||||||||||||||
| 59 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('allocate.smd must be of type mark:idType') unless $rh->{smd}=~m/^\d+-\d+$/; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 60 | 0 | push @data, ['allocate:smdId', $rh->{smd}]; | |||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||
| 62 | 0 | ▶ | if (Net::DRI::Util::has_key($rh, 'notice')) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 63 | { | ||||||||||||||||||||||||||||
| 64 | 0 | my $rn = $rh->{'notice'}; | |||||||||||||||||||||||||||
| 65 | 0 | foreach my $param (qw/id expiration_date accepted_date/) | |||||||||||||||||||||||||||
| 66 | { | ||||||||||||||||||||||||||||
| 67 | 0 | ▶ | Net::DRI::Exception::usererr_insufficient_parameters("allocate.notice.$param must be defined") unless Net::DRI::Util::has_key($rn, $param); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||
| 69 | 0 | my @notice; | |||||||||||||||||||||||||||
| 70 | my %attr; | ||||||||||||||||||||||||||||
| 71 | 0 | ▶ | if (Net::DRI::Util::has_key($rn, 'validator_id')) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 72 | { | ||||||||||||||||||||||||||||
| 73 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('allocate.notice.validator_id must be an XML token with at least 1 character') unless Net::DRI::Util::xml_is_token($rn->{validator_id}, 1); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 74 | 0 | $attr{validatorID} = $rn->{validator_id}; | |||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||
| 76 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('allocate.notice.id must be an XML token with at least 1 character') unless Net::DRI::Util::xml_is_token($rn->{id}, 1); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 77 | 0 | push @notice, ['launch:noticeID', $rn->{id}, %attr]; | |||||||||||||||||||||||||||
| 78 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('allocate.notice.expiration_date must be a DateTime object') unless Net::DRI::Util::check_isa($rn->{expiration_date}, 'DateTime'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 79 | 0 | push @notice, ['launch:notAfter', $rn->{expiration_date}->clone()->set_time_zone('UTC')->strftime('%Y-%m-%dT%H:%M:%SZ')]; | |||||||||||||||||||||||||||
| 80 | 0 | ▶ | Net::DRI::Exception::usererr_invalid_parameters('allocate.notice.accepted_date must be a DateTime object') unless Net::DRI::Util::check_isa($rn->{accepted_date}, 'DateTime'); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 81 | 0 | push @notice, ['launch:acceptedDate', $rn->{accepted_date}->clone()->set_time_zone('UTC')->strftime('%Y-%m-%dT%H:%M:%SZ')]; | |||||||||||||||||||||||||||
| 82 | 0 | push @data, ['allocate:notice', @notice]; | |||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||
| 85 | 0 | my $mes=$epp->message(); | |||||||||||||||||||||||||||
| 86 | 0 | my $eid=$mes->command_extension_register('allocate', 'create'); | |||||||||||||||||||||||||||
| 87 | 0 | $mes->command_extension($eid, \@data); | |||||||||||||||||||||||||||
| 88 | 0 | return; | |||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||
| 91 | #################################################################################################### | ||||||||||||||||||||||||||||
| 92 | 1 | 1; | |||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||
| 94 | __END__ | ||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||
| 96 | =pod | ||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||
| 98 | =head1 NAME | ||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||
| 100 | Net::DRI::Protocol::EPP::Extensions::Nomulus::Allocate - EPP Allocate Nomulus Extension mapping for Net::DRI | ||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||
| 102 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||
| 104 | Please see the README file for details. | ||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||
| 106 | From Google documentation: | ||||||||||||||||||||||||||||
| 107 | Domain name extension schema for allocating domains from applications. | ||||||||||||||||||||||||||||
| 108 | This is a proprietary, internal-only, non-public extension only for use | ||||||||||||||||||||||||||||
| 109 | inside the Google registry. | ||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||
| 111 | =head1 SUPPORT | ||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||
| 113 | For now, support questions should be sent to: | ||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||
| 115 | E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||
| 117 | Please also see the SUPPORT file in the distribution. | ||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||
| 119 | =head1 SEE ALSO | ||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||
| 121 | E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt> | ||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||
| 123 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||
| 125 | Patrick Mevzek, E<lt>netdri@dotandco.comE<gt> | ||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||
| 127 | =head1 COPYRIGHT | ||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||
| 129 | Copyright (c) 2017-2018 Patrick Mevzek <netdri@dotandco.com>. | ||||||||||||||||||||||||||||
| 130 | All rights reserved. | ||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||
| 132 | This program is free software; you can redistribute it and/or modify | ||||||||||||||||||||||||||||
| 133 | it under the terms of the GNU General Public License as published by | ||||||||||||||||||||||||||||
| 134 | the Free Software Foundation; either version 2 of the License, or | ||||||||||||||||||||||||||||
| 135 | (at your option) any later version. | ||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||
| 137 | See the LICENSE file that comes with this distribution for more details. | ||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||
| 139 | =cut | ||||||||||||||||||||||||||||