DRI/Protocol/EPP/Extensions/DNAME.pm

filter: Statementstmt 38.1% 16 / 42 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 45.4% 5 / 11 Podpod 0.0% 0 / 6 totaltotal 31.3% 21 / 67 CC 5 SCAR 17.3
CC
5
Cov
32%
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 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 {
28 0 ▶ my ($class,$version)=@_;
Subroutine register_commands: not called CC=1 SCAR=6.9
Pod undocumented
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 {
42 0 ▶ my ($class,$po,$version)=@_;
Subroutine setup: not called CC=1 SCAR=6.9
Pod undocumented
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 {
55 0 ▶ my ($epp,$domain,$data)=@_;
Subroutine command: not called CC=3 SCAR=24.8
Pod undocumented
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 my $mes=$epp->message();
63 0 my $eid=$mes->command_extension_register('dnameDeleg','dnameTarget');
64 0 $mes->command_extension($eid,$dname);
65  
66 0 return;
67 }
68  
69 sub info_parse
70 {
71 0 ▶ my ($po,$otype,$oaction,$oname,$rinfo)=@_;
Subroutine info_parse: not called CC=3 SCAR=24.8
Pod undocumented
72 0 my $mes=$po->message();
73 0 ▶ return unless $mes->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $mes->is_success 0 0 0
74  
75 0 my $data=$mes->get_extension('dnameDeleg','dnameTarget');
76 0 ▶ return unless defined $data;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $data 0 0 0
77 0 $rinfo->{domain}->{$oname}->{dname}=$data->textContent();
78  
79 0 return;
80 }
81  
82 ####################################################################################################
83 1 1;
84  
85 __END__
86  
87 =pod
88  
89 =head1 NAME
90  
91 Net::DRI::Protocol::EPP::Extensions::DNAME - EPP Mapping for DNAME delegation of domain names (draft-bortzmeyer-regext-epp-dname-02) for Net::DRI
92  
93 =head1 DESCRIPTION
94  
95 Please see the README file for details.
96  
97 =head1 SUPPORT
98  
99 For now, support questions should be sent to:
100  
101 E<lt>netdri@dotandco.comE<gt>
102  
103 Please also see the SUPPORT file in the distribution.
104  
105 =head1 SEE ALSO
106  
107 E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
108  
109 =head1 AUTHOR
110  
111 Patrick Mevzek, E<lt>netdri@dotandco.comE<gt>
112  
113 =head1 COPYRIGHT
114  
115 Copyright (c) 2018 Patrick Mevzek <netdri@dotandco.com>.
116 All rights reserved.
117  
118 This program is free software; you can redistribute it and/or modify
119 it under the terms of the GNU General Public License as published by
120 the Free Software Foundation; either version 2 of the License, or
121 (at your option) any later version.
122  
123 See the LICENSE file that comes with this distribution for more details.
124  
125 =cut
« DRI/Protocol/AFNIC/WS/Message.pm ↑ Summary DRI/Protocol/OpenSRS/XCP/Session.pm »