Net-DRI

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

= Contact/AFNIC : not using pragma encoding anymore, as it is advised in Perl documentation to avoid it in modules, due to its global scope
= Contact/AFNIC : new attribues vat and id_status + new method validate_registrant(), replacing validate_is_french() + new method init() to automatically set default srid
= Contact/AFNIC::validate() : calls SUPER::validate + added test on srid() vat(), better validation of contact data and standardization of API after addition of EPP at registry (per discussion with Jim Driscoll)
= ContactSet::get_all() new method
= Registry : add_profile() now completely replaces add_current_test_profile(), new_current_profile() and new_profile(); see files in eg/ and t/ for examples
= Registry : better logging in profile creation and process()/process_back() methods
= Transport : change of defaults, retry=2 (this means 2 tries totally) and timeout=60 now, instead of 1 and 0 (no timeout) + better default try_again()
= Transport subclasses : the new() input API is normalized with only a context and a ref hash in all cases
= Transport,Transport/HTTP,Transport/Socket,Protocol connection classes read_data() : better information in error messages
= Transport/Socket : you can use ssl_passwd_cb if you need to decrypt the SSL key before using it
= Transport/Socket : the ssl_verify_callback called gets the transport object as first parameter, before IO::Socket::SSL parameters
= Transport/Socket : more logging + better handling of connection closing/sensing EOF
= Protocol : add many default factories + new methods parse_iso8601() build_parser_strptime() to simplify subclasses work + new method has_module()
= Protocol connection classes : added transport_default() methods where needed
= Protocol classes : new() API expects a ref hash
= Protocol/ResultStatus : for get_data methods, the previous "command" attribute is now "raw_command", and "reply" is "raw_reply", "action" is "object_action", "type" is "object_type", and added "object_name" "registry" "profile" "protocol" "transpor...
= Protocol/ResultStatus : in get_data() get_data_collection() keys are normalized so that domain and host names can be used in lower or upper case (same as for DRD::get_info), see examples at bottom of t/601vnds_epp.t
= Protocol/ResultStatus : new last() method
= Protocol/OpenSRS/XCP/Domain : added operations check create delete renew transfer_request transfer_query transfer_cancel (contributed by Richard Siddall)
= Protocol/BookMyName/WS : implemented domain_check
= Protocol/Gandi/WS : implemented domain_check

Changes  view on Meta::CPAN

  for registries handling both. Changes are backwards compatible with previous version, but make
  sure to test on your systems before installing in production.
+ Protocol/ResultStatus : new print_full() method to have all details from registry
+ Data/Hosts : new set() method
+ Transport : we keep time of last use (idea from Brian), with method time_used()
= Transport/Socket : if sending fails, and retry > 1, we try to reconnect ; this is a crude way to handle registry timeouts
= local_object() enables you to create any kind of local objects, including hosts, contacts, contactsets,
  changes, etc... without having to load and directly call Net::DRI::Data::Hosts,Contact,ContactSet,Changes
  Please see the modified t/606eurid_epp.t for examples
= better error debugging in new_profile() when loading Transport and Protocol classes
= Transport/Socket : do not use IO::Socket::SSL::context_init anymore, it is marked as deprecated in module
- Protocol/EPP/Message : correct creation of <hello/> commands (bug found by Elias Sidenbladh)
- Protocol/{EPP,RRP}/Message : correct encoding of outgoing messages with Encode::encode()
- eg/eurid_epp.pl : the filehandle used for logging must be closed after $dri->end() not before

0.20 2005-12-02

+ EURid/Sunrise : we automatically reconnect after each apply command (successful or not), when needed,
                  since the connection is dropped by registry (bug reported by Lucas Vossberg)
+ Transport/Socket : a client certificate is no more mandatory, the default verification level is lowered,
                     better error message for SSL problems (suggested by Peter van Dijk)

META.yml  view on Meta::CPAN

    Carp:                          0
    Class::Accessor:               0
    Class::Accessor::Chained:      0
    DateTime:                      0
    DateTime::Duration:            0
    DateTime::Format::ISO8601:     0.06
    DateTime::Format::Strptime:    0
    DateTime::TimeZone:            0
    Email::Valid:                  0
    IO::Socket::INET:              0
    IO::Socket::SSL:               0.90
    Test::More:                    0
    Time::HiRes:                   0
    UNIVERSAL::require:            0
    XML::LibXML:                   1.61
meta-spec:
    url:     http://module-build.sourceforge.net/META-spec-v1.3.html
    version: 1.3

Makefile.PL  view on Meta::CPAN

        'Test::More' => 0,
        'DateTime' => 0,
        'DateTime::Duration' => 0,
        'DateTime::Format::Strptime' => 0,
        'DateTime::TimeZone' => 0,
	'DateTime::Format::ISO8601' => '0.06', ## version 0.0403 is also ok, version 0.05 IS NOT OK !
        'Class::Accessor' => 0,
        'Class::Accessor::Chained' => 0,
        'Time::HiRes' => 0,
	'IO::Socket::INET' => 0,
        'IO::Socket::SSL' => '0.90',
	'Email::Valid' => 0,
	'XML::LibXML' => '1.61',
	'UNIVERSAL::require' => 0,
    },
    dist                => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
    clean               => { FILES => 'Net-DRI-*' },
);

README  view on Meta::CPAN

DateTime
DateTime::Duration
DateTime::Format::Strptime
DateTime::Format::ISO8601 (>=0.06)
DateTime::TimeZone
Class::Accessor
Class::Accessor::Chained
Time::HiRes
Email::Valid
IO::Socket::INET (*)
IO::Socket::SSL (>=0.90)
XML::LibXML (>=1.61)
UNIVERSAL::require
SOAP::Lite (needed only for AFNIC, BookMyName, OVH, Gandi webservices)
SOAP::WSDL (needed only for OVH webservices)
MIME::Entity (needed only for AFNIC emails)
Net::SMTP (needed only for AFNIC emails)
LWP::UserAgent (needed only for OpenSRS, .PL and .IT)
Digest::MD5 (needed only for OpenSRS)
Net::DNS (needed only for .DE IRIS DCHK queries)
IO::Uncompress::RawInflate (needed only for .DE IRIS DCHK queries) (*)

lib/Net/DRI/Transport/Socket.pm  view on Meta::CPAN


package Net::DRI::Transport::Socket;

use base qw(Net::DRI::Transport);

use strict;
use warnings;

use IO::Socket::INET;
## At least this version is needed, to have getline()
use IO::Socket::SSL 0.90;

use Net::DRI::Exception;
use Net::DRI::Util;
use Net::DRI::Data::Raw;

our $VERSION=do { my @r=(q$Revision: 1.32 $=~/\d+/g); sprintf("%d".".%02d" x $#r, @r); };

=pod

=head1 NAME

lib/Net/DRI/Transport/Socket.pm  view on Meta::CPAN

=head1 METHODS

At creation (see Net::DRI C<new_profile>) you pass a reference to an hash, with the following available keys:

=head2 socktype

ssl, tcp or udp

=head2 ssl_key_file ssl_cert_file ssl_ca_file ssl_ca_path ssl_cipher_list ssl_version ssl_passwd_cb

if C<socktype> is 'ssl', all key materials, see IO::Socket::SSL documentation for corresponding options

=head2 ssl_verify

see IO::Socket::SSL documentation about verify_mode (by default 0x00 here)

=head2 ssl_verify_callback

see IO::Socket::SSL documentation about verify_callback, it gets here as first parameter the transport object
then all parameter given by IO::Socket::SSL; it is explicitely verified that the subroutine returns a true value,
and if not the connection is aborted.

=head2 remote_host remote_port

hostname (or IP address) & port number of endpoint

=head2 client_login client_password

protocol login & password

lib/Net/DRI/Transport/Socket.pm  view on Meta::CPAN

 {
  Net::DRI::Exception::usererr_insufficient_parameters($p.' must be defined') unless (exists($opts{$p}) && $opts{$p});
  $t{$p}=$opts{$p};
 }

 Net::DRI::Exception::usererr_invalid_parameters('close_after must be an integer') if ($opts{close_after} && !Net::DRI::Util::isint($opts{close_after}));
 $t{close_after}=$opts{close_after} || 0;

 if ($t{socktype} eq 'ssl')
 {
  $IO::Socket::SSL::DEBUG=$opts{ssl_debug} if exists($opts{ssl_debug});

  my %s=(SSL_use_cert => 0);
  $s{SSL_verify_mode}=(exists($opts{ssl_verify}))? $opts{ssl_verify} : 0x00; ## by default, no authentication whatsoever
  $s{SSL_verify_callback}=sub { my $r=$opts{ssl_verify_callback}->($self,@_); Net::DRI::Exception->die(1,'transport/socket',6,'SSL certificate user verification failed, aborting connection') unless $r; 1; } if (exists $opts{ssl_verify_callback} && de...
  foreach my $s (qw/key_file cert_file ca_file ca_path version passwd_cb/)
  {
   next unless exists($opts{'ssl_'.$s});
   $s{'SSL_'.$s}=$opts{'ssl_'.$s};
  }
  $s{SSL_use_cert}=1 if exists($s{SSL_cert_file});

lib/Net/DRI/Transport/Socket.pm  view on Meta::CPAN

 my %n=( PeerAddr   => $t->{remote_host},
         PeerPort   => $t->{remote_port},
         Proto      => $t->{socktype} eq 'udp'? 'udp' : 'tcp',
         Blocking   => 1,
	 MultiHomed => 1,
       );
 $n{LocalAddr}=$t->{local_host} if exists($t->{local_host});

 if ($type eq 'ssl')
 {
  $sock=IO::Socket::SSL->new(%{$t->{ssl_context}},
                             %n,
                            );
 }
 if ($type eq 'tcp' || $type eq 'udp')
 {
  $sock=IO::Socket::INET->new(%n);
 }

 Net::DRI::Exception->die(1,'transport/socket',6,'Unable to setup the socket for '.$t->{remote_uri}.' with error: "'.$!.($type eq 'ssl'? '" and SSL error: "'.IO::Socket::SSL::errstr().'"' : '"')) unless defined $sock;
 $sock->autoflush(1);
 $self->sock($sock);
 $self->log_output('notice','transport',$ctx,{phase=>'opening',message=>'Successfully opened socket to '.$t->{remote_uri}});
 return;
}

sub send_login
{
 my ($self,$ctx)=@_;
 my $t=$self->transport_data();



( run in 0.594 second using v1.01-cache-2.11-cpan-4d50c553e7e )