DRI/DRD/DENIC.pm

filter: Statementstmt 43.5% 27 / 62 Branchbran 5.5% 1 / 18 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 47.6% 10 / 21 Podpod 26.6% 4 / 15 totaltotal 34.7% 42 / 121 CC 11 SCAR 27.9
CC
11
Cov
34%
domain_update
56.0
contact_update
20.0
transport_protocol_default
2.3
CRAP 16.2
« DRI/Protocol/DAS/SIDN/Domain.pm ↑ Summary DRI/Logging/Files.pm »
1 ## Domain Registry Interface, DENIC policies
2 ##
3 ## Copyright (c) 2007,2008,2009 Tonnerre Lombard <tonnerre.lombard@sygroup.ch>. All rights reserved.
4 ## (c) 2010,2011,2014 Patrick Mevzek <netdri@dotandco.com>. All rights reserved.
5 ## (c) 2012-2013 Michael Holloway <michael@thedarkwinter.com>. All rights reserved.
6 ##
7 ## This file is part of Net::DRI
8 ##
9 ## Net::DRI is free software; you can redistribute it and/or modify
10 ## it under the terms of the GNU General Public License as published by
11 ## the Free Software Foundation; either version 2 of the License, or
12 ## (at your option) any later version.
13 ##
14 ## See the LICENSE file that comes with this distribution for more details.
15 ####################################################################################################
16  
17 package Net::DRI::DRD::DENIC;
18  
19 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 2 ▶use base qw/Net::DRI::DRD/;
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 2 ▶use DateTime::Duration;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 2 ▶use Net::DRI::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
27  
28 =pod
29  
30 =head1 NAME
31  
32 Net::DRI::DRD::DENIC - DENIC (.DE) policies for Net::DRI
33  
34 =head1 DESCRIPTION
35  
36 Please see the README file for details.
37  
38 =head1 SUPPORT
39  
40 For now, support questions should be sent to:
41  
42 E<lt>tonnerre.lombard@sygroup.chE<gt>
43  
44 Please also see the SUPPORT file in the distribution.
45  
46 =head1 SEE ALSO
47  
48 E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
49  
50 =head1 AUTHOR
51  
52 Tonnerre Lombard, E<lt>tonnerre.lombard@sygroup.chE<gt>
53  
54 =head1 COPYRIGHT
55  
56 Copyright (c) 2007,2008,2009 Tonnerre Lombard <tonnerre.lombard@sygroup.ch>.
57 (c) 2010,2011,2014 Patrick Mevzek <netdri@dotandco.com>.
58 (c) 2012 Michael Holloway <michael@thedarkwinter.com>.
59 All rights reserved.
60  
61 This program is free software; you can redistribute it and/or modify
62 it under the terms of the GNU General Public License as published by
63 the Free Software Foundation; either version 2 of the License, or
64 (at your option) any later version.
65  
66 See the LICENSE file that comes with this distribution for more details.
67  
68 =cut
69  
70 ####################################################################################################
71  
72 sub new
73 1 ▶{
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
74 1 my $class=shift;
75 1 my $self=$class->SUPER::new(@_);
76 1 $self->{info}->{host_as_attr}=1;
77 1 return $self;
78 }
79  
80 0 ▶sub periods { return map { DateTime::Duration->new(years => $_) } (1..10); }
Subroutine periods: not called CC=1 SCAR=6.9
Pod documented
81 1 ▶sub name { return 'DENIC'; }
Subroutine name: called CC=1 SCAR=0.0
Pod documented
82 1 ▶sub tlds { return ('de','9.4.e164.arpa'); } ## *.9.4.e164.arpa could be queried over IRIS DCHK in the past, do not know about RRI support
Subroutine tlds: called CC=1 SCAR=0.0
Pod documented
83 0 ▶sub object_types { return ('domain','contact'); }
Subroutine object_types: not called CC=1 SCAR=6.9
Pod documented
84 0 ▶sub profile_types { return qw/rri/; }
Subroutine profile_types: not called CC=1 SCAR=6.9
Pod undocumented
85  
86 sub transport_protocol_default
87 1 ▶{
Subroutine transport_protocol_default: called CC=2 SCAR=8.1
Pod undocumented
88 1 my ($self,$type)=@_;
89  
90 1 ▶ return ('Net::DRI::Transport::Socket',{remote_host=>'rri.test.denic.de',remote_port=>51131,defer=>1,close_after=>1,socktype=>'tcp'},'Net::DRI::Protocol::RRI',{version=>'2.0'}) if $type eq 'rri';
Branch: 1 branch
BranchTrueFalseTotal
if $type eq "rri" 1 0 1
91 0 return;
92 }
93  
94 ####################################################################################################
95  
96 sub verify_name_domain
97 0 ▶{
Subroutine verify_name_domain: not called CC=1 SCAR=6.9
Pod undocumented
98 0 my ($self,$ndr,$domain,$op)=@_;
99 0 return $self->_verify_name_rules($domain,$op,{check_name => 1,
100 my_tld => 1,
101 icann_reserved => 1, ## is that right ??
102 });
103 }
104  
105 sub contact_update
106 0 ▶{
Subroutine contact_update: not called CC=4 SCAR=30.0
Pod undocumented
107 0 my ($self, $reg, $c, $changes, $rd) = @_;
108 0 my $oc = $reg->get_info('self', 'contact', $c->srid());
109  
110 0 ▶ if (!defined($oc))
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $oc) 0 0 0
111 {
112 0 my $res = $reg->process('contact', 'info',
113 [$reg->local_object('contact')->srid($c->srid())]);
114 0 ▶ $oc = $reg->get_info('self', 'contact', $c->srid())
Branch: 1 branch
BranchTrueFalseTotal
if $res->is_success 0 0 0
115 if ($res->is_success());
116 }
117  
118 0 ▶ $c->type($oc->type()) if (defined($oc));
Branch: 1 branch
BranchTrueFalseTotal
if defined $oc 0 0 0
119  
120 0 return $self->SUPER::contact_update($reg, $c, $changes, $rd);
121 }
122  
123 sub domain_update
124 0 ▶{
Subroutine domain_update: not called CC=7 SCAR=40.3
Pod undocumented
125 0 my ($self, $reg, $dom, $changes, $rd) = @_;
126 0 $rd=Net::DRI::Util::create_params('domain_update',$rd);
127 0 my $cs = $reg->get_info('contact', 'domain', $dom);
128 0 my $ns = $reg->get_info('ns', 'domain', $dom);
129  
130 0 ▶ if (!defined($cs) || !defined($ns))
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $cs and defined $ns) 0 0 0
Condition0%0/3
defined $cs and defined $ns
!ll&&!rl&&r
000
MC/DC0%0/2
defined $cs and defined $ns
defined $cs defined $ns
Truth table0%0/3
A and B
A= defined $csB= defined $ns
ABresult
0X0
100
111
131 {
132 0 my $res = $reg->process('domain', 'info', [$dom]);
133 0 ▶ $cs = $reg->get_info('contact', 'domain', $dom) if ($res->is_success());
Branch: 1 branch
BranchTrueFalseTotal
if $res->is_success 0 0 0
134 0 ▶ $ns = $reg->get_info('ns', 'domain', $dom) if ($res->is_success());
Branch: 1 branch
BranchTrueFalseTotal
if $res->is_success 0 0 0
135 }
136  
137 0 ▶ $rd->{contact} = $cs unless (defined($rd->{contact}));
Branch: 1 branch
BranchTrueFalseTotal
unless defined $rd->{"contact"} 0 0 0
138 0 ▶ $rd->{ns} = $ns unless (defined($rd->{ns}));
Branch: 1 branch
BranchTrueFalseTotal
unless defined $rd->{"ns"} 0 0 0
139  
140 0 return $self->SUPER::domain_update($reg, $dom, $changes, $rd);
141 }
142  
143 sub domain_trade
144 0 ▶{
Subroutine domain_trade: not called CC=1 SCAR=6.9
Pod undocumented
145 0 my ($self, $reg, $dom, $rd) = @_;
146 0 return $reg->process('domain', 'trade', [$dom, $rd]);
147 }
148  
149 sub domain_transit
150 0 ▶{
Subroutine domain_transit: not called CC=1 SCAR=6.9
Pod undocumented
151 0 my ($self, $reg, $dom, $rd) = @_;
152 0 return $reg->process('domain', 'transit', [$dom, $rd]);
153 }
154  
155 sub domain_migrate_descr
156 0 ▶{
Subroutine domain_migrate_descr: not called CC=1 SCAR=6.9
Pod undocumented
157 0 my ($self, $reg, $dom, $rd) = @_;
158 0 return $reg->process('domain', 'migrate_descr', [$dom, $rd]);
159 }
160  
161 sub domain_create_authinfo
162 0 ▶{
Subroutine domain_create_authinfo: not called CC=1 SCAR=6.9
Pod undocumented
163 0 my ($self, $reg, $dom, $rd) = @_;
164 0 return $reg->process('domain', 'create_authinfo', [$dom, $rd]);
165 }
166  
167 sub domain_delete_authinfo
168 0 ▶{
Subroutine domain_delete_authinfo: not called CC=1 SCAR=6.9
Pod undocumented
169 0 my ($self, $reg, $dom, $rd) = @_;
170 0 return $reg->process('domain', 'delete_authinfo', [$dom, $rd]);
171 }
172  
173 ####################################################################################################
174 2 1;
« DRI/Protocol/DAS/SIDN/Domain.pm ↑ Summary DRI/Logging/Files.pm »