DRI/DRD/VeriSign/NAME.pm

filter: Statementstmt 42.0% 29 / 69 Branchbran 6.2% 1 / 16 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 47.6% 10 / 21 Podpod 26.6% 4 / 15 totaltotal 36.3% 44 / 121 CC 10 SCAR 15.7
CC
10
Cov
35%
emailfwd_update
12.0
emailfwd_renew
12.0
emailfwd_check
6.0
CRAP 4.8
« DRI/Protocol/Whois/Domain/AERO.pm ↑ Summary DRI/DRD/NicAT.pm »
1 ## Domain Registry Interface, VeriSign Registry Driver for .NAME
2 ##
3 ## Copyright (c) 2007-2009,2011 HEXONET Support GmbH, www.hexonet.com, Alexander Biehl <info@hexonet.com>. All rights reserved
4 ## Copyright (c) 2005-2013,2016 Patrick Mevzek <netdri@dotandco.com>. All rights reserved.
5 ##
6 ## This file is part of Net::DRI
7 ##
8 ## Net::DRI is free software; you can redistribute it and/or modify
9 ## it under the terms of the GNU General Public License as published by
10 ## the Free Software Foundation; either version 2 of the License, or
11 ## (at your option) any later version.
12 ##
13 ## See the LICENSE file that comes with this distribution for more details.
14 ####################################################################################################
15  
16 package Net::DRI::DRD::VeriSign::NAME;
17  
18 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 2 ▶use base qw/Net::DRI::DRD/;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 2 ▶use DateTime::Duration;
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 2 ▶use Net::DRI::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 2 ▶use Net::DRI::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
27  
28 =pod
29  
30 =head1 NAME
31  
32 Net::DRI::DRD::VeriSign::NAME - VeriSign .NAME Registry driver 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>netdri@dotandco.comE<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 Patrick Mevzek, E<lt>netdri@dotandco.comE<gt>
53  
54 =head1 COPYRIGHT
55  
56 Copyright (c) 2007-2009,2011 Alexander Biehl <info@hexonet.com>.
57 Copyright (c) 2005-2013,2016 Patrick Mevzek <netdri@dotandco.com>.
58 All rights reserved.
59  
60 This program is free software; you can redistribute it and/or modify
61 it under the terms of the GNU General Public License as published by
62 the Free Software Foundation; either version 2 of the License, or
63 (at your option) any later version.
64  
65 See the LICENSE file that comes with this distribution for more details.
66  
67 =cut
68  
69 ####################################################################################################
70  
71 sub new
72 {
73 1 ▶ my $class=shift;
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
74 1 my $self=$class->SUPER::new(@_);
75 1 $self->{info}->{host_as_attr}=0;
76 1 $self->{info}->{contact_i18n}=2; ## INT only
77 1 $self->{info}->{check_limit}=5;
78 1 return $self;
79 }
80  
81 0 ▶sub periods { return map { DateTime::Duration->new(years => $_) } (1..10); }
Subroutine periods: not called CC=1 SCAR=6.9
Pod documented
82 1 ▶sub name { return 'VeriSign::NAME'; }
Subroutine name: called CC=1 SCAR=0.0
Pod documented
83 1 ▶sub tlds { return qw/name/; }
Subroutine tlds: called CC=1 SCAR=0.0
Pod documented
84 0 ▶sub object_types { return qw/domain contact ns/; }
Subroutine object_types: not called CC=1 SCAR=6.9
Pod documented
85 0 ▶sub profile_types { return qw/epp whois/; }
Subroutine profile_types: not called CC=1 SCAR=6.9
Pod undocumented
86  
87 sub transport_protocol_default
88 {
89 1 ▶ my ($self,$type)=@_;
Subroutine transport_protocol_default: called CC=3 SCAR=16.5
Pod undocumented
90  
91 1 ▶ return ('Net::DRI::Transport::Socket',{remote_host=>'nameeppote.verisign-grs.com', remote_port=>700},'Net::DRI::Protocol::EPP::Extensions::VeriSign::Platforms::NAME',{}) if $type eq 'epp';
Branch: 1 branch
BranchTrueFalseTotal
if $type eq "epp" 1 0 1
92 0 ▶ return ('Net::DRI::Transport::Socket',{remote_host=>'whois.nic.name'},'Net::DRI::Protocol::Whois',{}) if $type eq 'whois';
Branch: 1 branch
BranchTrueFalseTotal
if $type eq "whois" 0 0 0
93 0 return;
94 }
95  
96 ####################################################################################################
97  
98 sub verify_name_domain
99 {
100 0 ▶ my ($self,$ndr,$domain,$op)=@_;
Subroutine verify_name_domain: not called CC=1 SCAR=6.9
Pod undocumented
101 0 return $self->_verify_name_rules($domain,$op,{check_name => 1,
102 check_name_dots => [1,2],
103 my_tld_not_strict => 1, ## we need less strict checks because in X.Y.name domain names both X and Y are variables
104 icann_reserved => 1,
105 });
106 }
107  
108 sub emailfwd_check
109 {
110 0 ▶ my ($self,$ndr,$email)=@_;
Subroutine emailfwd_check: not called CC=2 SCAR=17.9
Pod undocumented
111 ## Technical syntax check of email object needed here
112 0 my $rc=$ndr->try_restore_from_cache('emailfwd',$email,'check');
113 0 ▶ if (! defined $rc) { $rc=$ndr->process('emailfwd','check',[$email]); }
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $rc) 0 0 0
114 0 return $rc;
115 }
116  
117 sub emailfwd_exist ## 1/0/undef
118 {
119 0 ▶ my ($self,$ndr,$email)=@_;
Subroutine emailfwd_exist: not called CC=2 SCAR=17.9
Pod undocumented
120 ## Technical syntax check of email object needed here
121 0 my $rc=$ndr->emailfwd_check($email);
122 0 ▶ return unless $rc->is_success();
Branch: 1 branch
BranchTrueFalseTotal
unless $rc->is_success 0 0 0
123 0 return $ndr->get_info('exist');
124 }
125  
126 sub emailfwd_info
127 {
128 0 ▶ my ($self,$ndr,$email)=@_;
Subroutine emailfwd_info: not called CC=2 SCAR=17.9
Pod undocumented
129 ## Technical syntax check of email object needed here
130 0 my $rc=$ndr->try_restore_from_cache('emailfwd',$email,'info');
131 0 ▶ if (! defined $rc) { $rc=$ndr->process('emailfwd','info',[$email]); }
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $rc) 0 0 0
132 0 return $rc;
133 }
134  
135 sub emailfwd_create
136 {
137 0 ▶ my ($self,$ndr,$email,$rd)=@_;
Subroutine emailfwd_create: not called CC=1 SCAR=6.9
Pod undocumented
138 ## Technical syntax check of email object needed here
139 0 my $rc=$ndr->process('emailfwd','create',[$email,$rd]);
140 0 return $rc;
141 }
142  
143 sub emailfwd_delete
144 {
145 0 ▶ my ($self,$ndr,$email)=@_;
Subroutine emailfwd_delete: not called CC=1 SCAR=6.9
Pod undocumented
146 ## Technical syntax check of email object needed here
147 0 my $rc=$ndr->process('emailfwd','delete',[$email]);
148 0 return $rc;
149 }
150  
151 sub emailfwd_update
152 {
153 0 ▶ my ($self,$ndr,$email,$tochange)=@_;
Subroutine emailfwd_update: not called CC=3 SCAR=24.8
Pod undocumented
154 0 my $fp=$ndr->protocol->nameversion();
155  
156 ## Technical syntax check of email object needed here
157 0 Net::DRI::Util::check_isa($tochange,'Net::DRI::Data::Changes');
158  
159 0 foreach my $t ($tochange->types())
160 {
161 0 ▶ next if $ndr->protocol_capable('emailfwd_update',$t);
Branch: 1 branch
BranchTrueFalseTotal
if $ndr->protocol_capable("emailfwd_update", $t) 0 0 0
162 0 Net::DRI::Exception->die(0,'DRD',5,'Protocol '.$fp.' is not capable of emailfwd_update/'.$t);
163 }
164  
165 0 my $rc=$ndr->process('emailfwd','update',[$email,$tochange]);
166 0 return $rc;
167 }
168  
169 sub emailfwd_renew
170 {
171 0 ▶ my ($self,$ndr,$email,$rd)=@_;
Subroutine emailfwd_renew: not called CC=3 SCAR=24.8
Pod undocumented
172 ## Technical syntax check of email object needed here
173 0 ▶ Net::DRI::Util::check_isa($rd->{duration},'DateTime::Duration') if defined($rd->{duration});
Branch: 1 branch
BranchTrueFalseTotal
if defined $rd->{"duration"} 0 0 0
174 0 ▶ Net::DRI::Util::check_isa($rd->{current_expiration},'DateTime') if defined($rd->{current_expiration});
Branch: 1 branch
BranchTrueFalseTotal
if defined $rd->{"current_expiration"} 0 0 0
175 0 return $ndr->process('emailfwd','renew',[$email,$rd->{duration},$rd->{current_expiration}]);
176 }
177  
178 ####################################################################################################
179 2 1;
« DRI/Protocol/Whois/Domain/AERO.pm ↑ Summary DRI/DRD/NicAT.pm »