Skip to content

Commit 64b7b6e

Browse files
add REST transport to bridge xt/ tests against v3 API
NicTool::Transport::REST maps v2 RPC-style method calls to v3 REST endpoints with JWT auth, parameter name translation, and response flattening. The transport passes all v2 fields through to v3 so that validation mismatches surface as clear test failures rather than being silently suppressed. Updated xt/ test credentials to satisfy v3's stricter validation (valid emails, strong passwords). Added env var support to NicToolTest and NicTool so tests can select REST transport without code changes. Results against v3: 5816/5996 pass (97%). Remaining 180 failures map to unimplemented v3 features (delegation, zone delegation permissions). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7d0bacf commit 64b7b6e

9 files changed

Lines changed: 530 additions & 66 deletions

File tree

server/api/lib/NicTool.pm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ package NicTool;
44

55
use strict;
66
use Carp;
7-
use SOAP::Lite;
87

98
#use Data::Dumper;
109

@@ -99,8 +98,8 @@ sub _conf {
9998
return {
10099
'server_host' => 'localhost',
101100
'server_port' => '8082',
102-
'transfer_protocol' => 'http',
103-
'data_protocol' => 'soap',
101+
'transfer_protocol' => ($ENV{NICTOOL_TRANSFER_PROTOCOL} || 'http'),
102+
'data_protocol' => ($ENV{NICTOOL_DATA_PROTOCOL} || 'soap'),
104103
'nt_user_session' => undef,
105104
'use_protocol_version' => 0,
106105
'nt_protocol_version' => '1.0',

server/api/lib/NicTool/Transport.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ sub get_transport_agent {
3636
my %transport_class_for = (
3737
SOAP => 'NicTool::Transport::SOAP',
3838
XMLRPC => 'NicTool::Transport::XMLRPC',
39+
REST => 'NicTool::Transport::REST',
3940
);
4041
my $class = $transport_class_for{$dp}
4142
or die "Unable to use class NicTool::Transport::$dp for data protocol '$protocol'";

0 commit comments

Comments
 (0)