| 1 | ## Domain Registry Interface, Domain Verification Extension Mapping for EPP | ||||||||||||||
| 2 | ## | ||||||||||||||
| 3 | ## Copyright (c) 2016,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::DomainVerification; | ||||||||||||||
| 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 | 0 | ▶ | { | ||||||||||||
|
Subroutine
register_commands: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||
| 27 | 0 | my ($class,$version)=@_; | |||||||||||||
| 28 | 0 | state $rcmds = { 'domain' => { 'check' => [ undef, \&check_parse ], | |||||||||||||
| 29 | 'check_multi' => [ undef, \&check_parse ], | ||||||||||||||
| 30 | 'info' => [ undef, \&info_parse ], | ||||||||||||||
| 31 | }, | ||||||||||||||
| 32 | }; | ||||||||||||||
| 33 | 0 | return $rcmds; | |||||||||||||
| 34 | } | ||||||||||||||
| 35 | |||||||||||||||
| 36 | sub setup | ||||||||||||||
| 37 | 0 | ▶ | { | ||||||||||||
|
Subroutine
setup: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||
| 38 | 0 | my ($class,$po,$version)=@_; | |||||||||||||
| 39 | 0 | state $rns = { 'veridomain' => 'urn:ietf:params:xml:ns:veridomain-1.0' }; | |||||||||||||
| 40 | 0 | $po->ns($rns); | |||||||||||||
| 41 | 0 | return; | |||||||||||||
| 42 | } | ||||||||||||||
| 43 | |||||||||||||||
| 44 | 0 | ▶ | sub implements { return 'https://tools.ietf.org/html/draft-wang-eppext-domain-verification-01'; } | ||||||||||||
|
Subroutine
implements: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||
| 45 | |||||||||||||||
| 46 | #################################################################################################### | ||||||||||||||
| 47 | |||||||||||||||
| 48 | sub check_parse | ||||||||||||||
| 49 | 0 | ▶ | { | ||||||||||||
|
Subroutine
check_parse: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||
| 50 | 0 | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | |||||||||||||
| 51 | 0 | my $mes=$po->message(); | |||||||||||||
| 52 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 53 | |||||||||||||||
| 54 | 0 | my $data=$mes->get_extension('veridomain', 'chkData'); | |||||||||||||
| 55 | 0 | ▶ | return unless defined $data; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 56 | |||||||||||||||
| 57 | 0 | my %r; | |||||||||||||
| 58 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($data)) | |||||||||||||
| 59 | { | ||||||||||||||
| 60 | 0 | my ($name,$node)=@$el; | |||||||||||||
| 61 | 0 | ▶ | if ($name eq 'distinction') | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 62 | { | ||||||||||||||
| 63 | 0 | $rinfo->{'domain'}->{lc $node->getAttribute('name')}->{restriction}->{type}=$node->getAttribute('type'); | |||||||||||||
| 64 | } | ||||||||||||||
| 65 | } | ||||||||||||||
| 66 | |||||||||||||||
| 67 | 0 | return; | |||||||||||||
| 68 | } | ||||||||||||||
| 69 | |||||||||||||||
| 70 | sub info_parse | ||||||||||||||
| 71 | 0 | ▶ | { | ||||||||||||
|
Subroutine
info_parse: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||
| 72 | 0 | my ($po,$otype,$oaction,$oname,$rinfo)=@_; | |||||||||||||
| 73 | 0 | my $mes=$po->message(); | |||||||||||||
| 74 | 0 | ▶ | return unless $mes->is_success(); | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 75 | |||||||||||||||
| 76 | 0 | my $ns=$mes->ns('veridomain'); | |||||||||||||
| 77 | 0 | my $data=$mes->get_extension('veridomain', 'infData'); | |||||||||||||
| 78 | 0 | ▶ | return unless defined $data; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 79 | |||||||||||||||
| 80 | 0 | my %r; | |||||||||||||
| 81 | 0 | foreach my $el (Net::DRI::Util::xml_list_children($data)) | |||||||||||||
| 82 | { | ||||||||||||||
| 83 | 0 | my ($name,$node)=@$el; | |||||||||||||
| 84 | 0 | ▶ | if ($name eq 'status') | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 85 | { | ||||||||||||||
| 86 | 0 | $r{status}=$node->textContent(); | |||||||||||||
| 87 | } elsif ($name eq 'history') | ||||||||||||||
| 88 | { | ||||||||||||||
| 89 | 0 | foreach my $record (Net::DRI::Util::xml_list_children($node, 'record')) | |||||||||||||
| 90 | { | ||||||||||||||
| 91 | 0 | push @{$r{history}}, { date => $po->parse_iso8601(Net::DRI::Util::xml_child_content($record, $ns, 'date')), | |||||||||||||
| 92 | op => Net::DRI::Util::xml_child_content($record, $ns, 'op'), | ||||||||||||||
| 93 | clID => Net::DRI::Util::xml_child_content($record, $ns, 'clID'), | ||||||||||||||
| 94 | }; | ||||||||||||||
| 95 | } | ||||||||||||||
| 96 | } | ||||||||||||||
| 97 | } | ||||||||||||||
| 98 | |||||||||||||||
| 99 | 0 | $rinfo->{$otype}->{$oname}->{restriction}=\%r; | |||||||||||||
| 100 | |||||||||||||||
| 101 | 0 | return; | |||||||||||||
| 102 | } | ||||||||||||||
| 103 | |||||||||||||||
| 104 | #################################################################################################### | ||||||||||||||
| 105 | 1 | 1; | |||||||||||||
| 106 | |||||||||||||||
| 107 | __END__ | ||||||||||||||