DRI/Protocol/EPP/Extensions/DNAME.pm

filter: Statementstmt 40.0% 16 / 40 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 45.4% 5 / 11 Podpod 0.0% 0 / 6 totaltotal 32.3% 21 / 65 CC 5 SCAR 17.3
CC
5
Cov
33%
command
12.0
info_parse
12.0
register_commands
2.0
CRAP 5.7
« DRI/Protocol/AFNIC/WS/Message.pm ↑ Summary DRI/Protocol/OpenSRS/XCP/Session.pm »
1 ## EPP Mapping for DNAME delegation of domain names (draft-bortzmeyer-regext-epp-dname-02)
2 ##
3 ## Copyright (c) 2018-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::DNAME;
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 $rd = { info => [ undef, \&info_parse ] };
31 0 $rd->{create} = $rd->{update} = [ \&command, undef ];
32  
33 0 state $cmds = { 'domain' => $rd };
34  
35 0 return $cmds;
36 }
37  
38 0 ▶sub capabilities_add { return ['domain_update','dname',['set']]; }
Subroutine capabilities_add: not called CC=1 SCAR=6.9
Pod undocumented
39  
40 sub setup
41 0 ▶{
Subroutine setup: not called CC=1 SCAR=6.9
Pod undocumented
42 0 my ($class,$po,$version)=@_;
43  
44 0 state $ns = { 'dnameDeleg' => 'urn:ietf:params:xml:ns:dnameDeleg-1.0' };
45 0 $po->ns($ns);
46 0 return;
47 }
48  
49 0 ▶sub implements { return 'https://tools.ietf.org/html/draft-bortzmeyer-regext-epp-dname-02'; }
Subroutine implements: not called CC=1 SCAR=6.9
Pod undocumented
50  
51 ####################################################################################################
52  
53 sub command
54 0 ▶{
Subroutine command: not called CC=3 SCAR=24.8
Pod undocumented
55 0 my ($epp,$domain,$data)=@_;
56  
57 0 my $dname = $epp->extract_argument('dname', $data);
58 0 ▶ return unless defined $dname;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $dname 0 0 0
59  
60 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('Invalid syntax for DNAME: '.$dname) unless Net::DRI::Util::xml_is_token($dname, 1, 255);
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::xml_is_token($dname, 1, 255) 0 0 0
61  
62 0 $epp->message()->command_extension('dnameDeleg',['dnameTarget', $dname]);
63  
64 0 return;
65 }
66  
67 sub info_parse
68 0 ▶{
Subroutine info_parse: not called CC=3 SCAR=24.8
Pod undocumented
69 0 my ($po,$otype,$oaction,$oname,$rinfo)=@_;
70 0 my $mes=$po->message();
71 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
72  
73 0 my $data=$mes->get_extension('dnameDeleg','dnameTarget');
74 0 ▶ return unless defined $data;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $data 0 0 0
75 0 $rinfo->{domain}->{$oname}->{dname}=$data->textContent();
76  
77 0 return;
78 }
79  
80 ####################################################################################################
81 1 1;
82  
83 __END__
« DRI/Protocol/AFNIC/WS/Message.pm ↑ Summary DRI/Protocol/OpenSRS/XCP/Session.pm »