| 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; |