DRI/DRD/VeriSign/NameStore.pm

filter: Statementstmt 45.6% 21 / 46 Branchbran 8.3% 1 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 8 / 16 Podpod 33.3% 4 / 12 totaltotal 39.5% 34 / 86 CC 7 SCAR 17.5
CC
7
Cov
38%
domain_suggest
20.0
domain_whowas
6.0
transport_protocol_default
5.2
CRAP 5.8
« DRI/Protocol/RRP/Core/Status.pm ↑ Summary DRI/Data/Contact/TCI.pm »
1 ## Domain Registry Interface, VeriSign Registry Driver for .CC .TV .BZ .JOBS
2 ##
3 ## Copyright (c) 2005-2013,2016 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::DRD::VeriSign::NameStore;
16  
17 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 5 ▶use base qw/Net::DRI::DRD/;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 5 ▶use DateTime::Duration;
Subroutine BEGIN: called CC=1 SCAR=0.0
23  
24 =pod
25  
26 =head1 NAME
27  
28 Net::DRI::DRD::VeriSign::NameStore - VeriSign .CC/.TV/.BZ/.JOBS Registry driver for Net::DRI
29  
30 =head1 DESCRIPTION
31  
32 Please see the README file for details.
33  
34 =head1 SUPPORT
35  
36 For now, support questions should be sent to:
37  
38 E<lt>netdri@dotandco.comE<gt>
39  
40 Please also see the SUPPORT file in the distribution.
41  
42 =head1 SEE ALSO
43  
44 E<lt>http://www.dotandco.com/services/software/Net-DRI/E<gt>
45  
46 =head1 AUTHOR
47  
48 Patrick Mevzek, E<lt>netdri@dotandco.comE<gt>
49  
50 =head1 COPYRIGHT
51  
52 Copyright (c) 2005-2013,2016 Patrick Mevzek <netdri@dotandco.com>.
53 All rights reserved.
54  
55 This program is free software; you can redistribute it and/or modify
56 it under the terms of the GNU General Public License as published by
57 the Free Software Foundation; either version 2 of the License, or
58 (at your option) any later version.
59  
60 See the LICENSE file that comes with this distribution for more details.
61  
62 =cut
63  
64 ####################################################################################################
65  
66 sub new
67 {
68 4 ▶ my $class=shift;
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
69 4 my $self=$class->SUPER::new(@_);
70 4 $self->{info}->{check_limit}=5;
71 4 return $self;
72 }
73  
74 0 ▶sub periods { return map { DateTime::Duration->new(years => $_) } (1..10); }
Subroutine periods: not called CC=1 SCAR=6.9
Pod documented
75 4 ▶sub name { return 'VeriSign::NameStore'; }
Subroutine name: called CC=1 SCAR=0.0
Pod documented
76 4 ▶sub tlds { return qw/cc tv bz jobs edu/; } ## If this changes, VeriSign/NameStore will need to be updated also
Subroutine tlds: called CC=1 SCAR=0.0
Pod documented
77 0 ▶sub object_types { return qw/domain contact ns/; }
Subroutine object_types: not called CC=1 SCAR=6.9
Pod documented
78 0 ▶sub profile_types { return qw/epp whois/; }
Subroutine profile_types: not called CC=1 SCAR=6.9
Pod undocumented
79  
80 sub transport_protocol_default
81 {
82 4 ▶ my ($self,$type)=@_;
Subroutine transport_protocol_default: called CC=3 SCAR=16.5
Pod undocumented
83  
84 4 ▶ return ('Net::DRI::Transport::Socket',{remote_host=>'otessl.verisign-grs.com', remote_port=>700},'Net::DRI::Protocol::EPP::Extensions::VeriSign::Platforms::NameStore',{}) if $type eq 'epp';
Branch: 1 branch
BranchTrueFalseTotal
if $type eq "epp" 4 0 4
85 0 ▶ return ('Net::DRI::Transport::Socket',{remote_host=>'whois.verisign-grs.com'},'Net::DRI::Protocol::Whois',{}) if $type eq 'whois';
Branch: 1 branch
BranchTrueFalseTotal
if $type eq "whois" 0 0 0
86 0 return;
87 }
88  
89 ####################################################################################################
90  
91 sub verify_name_domain
92 {
93 0 ▶ my ($self,$ndr,$domain,$op)=@_;
Subroutine verify_name_domain: not called CC=1 SCAR=6.9
Pod undocumented
94 0 return $self->_verify_name_rules($domain,$op,{check_name => 1,
95 my_tld => 1,
96 icann_reserved => 1,
97 });
98 }
99  
100 ## We can not start a transfer, if domain name has already been transfered less than 15 days ago.
101 sub verify_duration_transfer
102 {
103 0 ▶ my ($self,$ndr,$duration,$domain,$op)=@_;
Subroutine verify_duration_transfer: not called CC=1 SCAR=6.9
Pod undocumented
104  
105 0 return $self->_verify_duration_transfer_15days($ndr,$duration,$domain,$op);
106 }
107  
108 ####################################################################################################
109  
110 sub domain_whowas
111 {
112 0 ▶ my ($self,$ndr,$domain,$rd)=@_;
Subroutine domain_whowas: not called CC=2 SCAR=17.9
Pod undocumented
113 0 $self->enforce_domain_name_constraints($ndr,$domain,'whowas');
114  
115 0 my $rc=$ndr->try_restore_from_cache('domain',$domain,'whowas');
116 0 ▶ if (! defined $rc) { $rc=$ndr->process('domain','whowas',[$domain,$rd]); }
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $rc) 0 0 0
117 0 return $rc;
118 }
119  
120 sub domain_suggest
121 {
122 0 ▶ my ($self,$ndr,$domain,$rd)=@_;
Subroutine domain_suggest: not called CC=4 SCAR=30.0
Pod undocumented
123 0 ▶ Net::DRI::Exception::usererr_invalid_parameters('domain_suggestion domain/key must be a string of 2 to 32 characters') unless Net::DRI::Util::xml_is_string($domain,2,32);
Branch: 1 branch
BranchTrueFalseTotal
unless Net::DRI::Util::xml_is_string($domain, 2, 32) 0 0 0
124 0 ▶ $self->enforce_domain_name_constraints($ndr,$domain,'suggestion') unless $domain=~m/\s/; ## if we have a space, then $domain is a list of keywords
Branch: 1 branch
BranchTrueFalseTotal
unless $domain =~ /\s/ 0 0 0
125 0 my $rc=$ndr->try_restore_from_cache('domain',$domain,'suggesion');
126 0 ▶ if (! defined $rc) { $rc=$ndr->process('domain','suggestion',[$domain,$rd]); }
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $rc) 0 0 0
127 0 return $rc;
128 }
129  
130 sub balance_info
131 {
132 0 ▶ my ($self,$ndr)=@_;
Subroutine balance_info: not called CC=1 SCAR=6.9
Pod undocumented
133 0 return $ndr->process('balance','info');
134 }
135  
136 ####################################################################################################
137 5 1;
« DRI/Protocol/RRP/Core/Status.pm ↑ Summary DRI/Data/Contact/TCI.pm »