thedarkwinter / Net-DRI

Perl EPP Client: Net-DRI-0.X_tdw based on Net-DRI-0.96_09
GNU General Public License v2.0
19 stars 15 forks source link

Neustar Ari fail on maintainance message #416

Closed ivan1986 closed 3 years ago

ivan1986 commented 3 years ago
<?xml version="1.0" encoding="UTF-8" standalone="no"?><epp xmlns="urn:ietf:params:xml:ns:epp-1.0"><response><result code="1301"><msg lang="en">Command completed successfully; ack to dequeue</msg></result><msgQ count="3105" id="132233258"><qDate>2021-01-25T02:43:09.434Z</qDate><msg lang="en">M024: The maintenance window Registry Scheduled Maintenance (dcf87b1c-f262-4179-846d-f0e82495cb72) has just been created within the Registry System</msg></msgQ><resData><maint:infData xmlns:maint="urn:ietf:params:xml:ns:maintenance-0.2"><maint:maint><maint:id>dcf87b1c-f262-4179-846d-f0e82495cb72</maint:id><maint:systems><maint:system><maint:name>EPP</maint:name><maint:host>epp.dnrs.neustar</maint:host><maint:impact>partial</maint:impact></maint:system><maint:system><maint:name>Portal</maint:name><maint:host>portal.dnrs.neustar</maint:host><maint:impact>partial</maint:impact></maint:system></maint:systems><maint:environment type="production"/><maint:start>2021-01-27T04:00:00.0Z</maint:start><maint:end>2021-01-27T08:00:00.0Z</maint:end><maint:reason>planned</maint:reason><maint:description>Registry Scheduled Maintenance - TLS update, only TLS 1.2 and 1.3 will be supported post maintenance. Refer to email notice for more details.</maint:description><maint:tlds><maint:tld>accountant</maint:tld><maint:tld>bible</maint:tld><maint:tld>bid</maint:tld><maint:tld>biz</maint:tld><maint:tld>buzz</maint:tld><maint:tld>cloud</maint:tld><maint:tld>club</maint:tld><maint:tld>co</maint:tld><maint:tld>courses</maint:tld><maint:tld>cricket</maint:tld><maint:tld>date</maint:tld><maint:tld>download</maint:tld><maint:tld>earth</maint:tld><maint:tld>faith</maint:tld><maint:tld>film</maint:tld><maint:tld>loan</maint:tld><maint:tld>melbourne</maint:tld><maint:tld>men</maint:tld><maint:tld>menu</maint:tld><maint:tld>moe</maint:tld><maint:tld>nyc</maint:tld><maint:tld>one</maint:tld><maint:tld>osaka</maint:tld><maint:tld>party</maint:tld><maint:tld>racing</maint:tld><maint:tld>review</maint:tld><maint:tld>science</maint:tld><maint:tld>stream</maint:tld><maint:tld>study</maint:tld><maint:tld>sucks</maint:tld><maint:tld>sydney</maint:tld><maint:tld>tel</maint:tld><maint:tld>trade</maint:tld><maint:tld>travel</maint:tld><maint:tld>tube</maint:tld><maint:tld>us</maint:tld><maint:tld>webcam</maint:tld><maint:tld>win</maint:tld></maint:tlds><maint:intervention><maint:connection>true</maint:connection><maint:implementation>true</maint:implementation></maint:intervention><maint:status>active</maint:status><maint:crDate>2021-01-25T02:43:02.476Z</maint:crDate></maint:maint></maint:infData></resData><trID><clTRID>ARI-118-1611731401814440</clTRID><svTRID>b120be58-9d2c-4b33-b20f-4f5d8d26c1e1</svTRID></trID></response></epp>

We received this image and get error processing

Index: api-epp-module/lib/perllib/Net/DRI/Protocol/EPP/Extensions/NeuLevel/Message.pm
===================================================================
--- api-epp-module.orig/lib/perllib/Net/DRI/Protocol/EPP/Extensions/NeuLevel/Message.pm
+++ api-epp-module/lib/perllib/Net/DRI/Protocol/EPP/Extensions/NeuLevel/Message.pm
@@ -22,7 +22,10 @@ use warnings;
 sub register_commands
 {
  my ($class,$version)=@_;
- return { 'message' => { 'result' => [ undef, \&parse ] } };
+ return { 'message' => {
+     'result' => [ undef, \&parse ],
+     'msgdata' => [ undef, \&parse_msg ],
+ } };
 }

 ## Parse error message with a <value> node in the oxrs namespace to enhance what is reported back to application
@@ -46,6 +49,16 @@ sub parse
  return;
 }

+sub parse_msg
+{
+ my ($po,$otype,$oaction,$oname,$rinfo)=@_;
+ my $mes=$po->message();
+ if ($mes->node_resdata()) {
+  $rinfo->{custom}->{resdata} = $mes->node_resdata();
+  return;
+ }
+ return;
+}
 ####################################################################################################
 1;

fix looks works

paullojorgge commented 3 years ago

@thedarkwinter @ivan1986 suggestion works fine. Thank you @ivan1986 :) I don't know if he submitted any pull request (if it's the case my apologies) but I submitted one here:

thedarkwinter commented 3 years ago

Thanks @ivan1986 and @paullojorgge . I have merged here https://github.com/thedarkwinter/Net-DRI/commit/13510b792b90afda5dc787f283e7178f46b9f4a8