DRI/Protocol/EPP/Extensions/Nominet/Session.pm untested

filter: Statementstmt 0.0% 0 / 30 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 38 CC 1 SCAR 6.9
CC
1
Cov
0%
register_commands
2.0
parse_greeting
2.0
BEGIN
2.0
CRAP 2.0
1 ## Domain Registry Interface, Nominet Session Command
2 ##
3 ## Copyright (c) 2005-2010,2012,2014 Patrick Mevzek <netdri@dotandco.com>. All rights reserved.
4 ## (c) 2013 Michael Holloway <michael@thedarkwinter.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::Protocol::EPP::Extensions::Nominet::Session;
17  
18 use strict;
19 use warnings;
20  
21 use Net::DRI::Util;
22 use Net::DRI::Exception;
23  
24 ####################################################################################################
25  
26 sub register_commands
27 {
28 my %s=(
29 'connect' => [ undef, \&parse_greeting ],
30 noop => [ undef, \&parse_greeting ],
31 );
32 return { 'session' => \%s };
33 }
34  
35 # Nominet anounces multiple versions of objects and extensions, but fails the login if you select multiple.
36 # Additionally, they annouce the schema's for standard EPP and Nominet EPP (which they are dropping 11/2013)
37 # This hard codes the selection, which is no doubt a bad idea, but its probably worse to select the latest
38 sub parse_greeting
39 {
40 my ($po,$otype,$oaction,$oname,$rinfo)=@_;
41 my $srv = $po->default_parameters()->{server};
42  
43 my @objNS = qw/domain contact host/;
44 $srv->{objects} = [ map { "urn:ietf:params:xml:ns:$_-1.0" } @objNS ];
45 my @extNS=qw/contact-nom-ext-1.0 domain-nom-ext-1.2 std-contact-id-1.0 std-fork-1.0 std-handshake-1.0 std-list-1.0 std-locks-1.0 std-notifications-1.2 std-release-1.0 std-unrenew-1.0 std-warning-1.1 nom-abuse-feed-1.0/;
46 $srv->{extensions_selected} = [ map { "http://www.nominet.org.uk/epp/xml/$_" } @extNS ];
47 push @{$srv->{extensions_selected}},'urn:ietf:params:xml:ns:secDNS-1.1';
48 return;
49 }
50  
51 ####################################################################################################
52 1;