chore: adjust machine display to include proxy info

Signed-off-by: Jonah Zürcher <jonah.zuercher@adfinis.com>
pull/592/head
jon4hz 8 months ago committed by Stéphane Lesimple
parent a03f8258fd
commit 2eb76c89a6
No known key found for this signature in database
GPG Key ID: 4B4A3289E9D35658

@ -1240,10 +1240,18 @@ $user = $user || $config->{'defaultLogin'} || $remoteself || $sysself;
# log request
osh_debug("final request : " . "$user\@$ip -p $port -- $command'\n");
my $displayLine = sprintf("%s => %s => %s",
my $displayLine = sprintf(
"%s => %s => %s",
OVH::Bastion::machine_display(ip => $hostfrom, port => $portfrom)->value,
OVH::Bastion::machine_display(ip => $bastionhost, port => $bastionport, user => $self)->value,
OVH::Bastion::machine_display(ip => $hostto, port => $port, user => $user)->value,
OVH::Bastion::machine_display(
ip => $hostto,
port => $port,
user => $user,
proxyIp => $proxyIp,
proxyPort => $proxyPort
)->value,
);
if (!$quiet) {

@ -683,7 +683,13 @@ sub access_modify {
else {
return R('ERR_CANNOT_OPEN_FILE', msg => "Error opening $file: $!");
}
my $machine = OVH::Bastion::machine_display(ip => $ip, port => $port, user => $user)->value;
my $machine = OVH::Bastion::machine_display(
ip => $ip,
port => $port,
user => $user,
proxyIp => $proxyIp,
proxyPort => $proxyPort
)->value;
my $ttlmsg =
$ttl ? (' (expires in ' . OVH::Bastion::duration2human(seconds => $ttl)->value->{'human'} . ')') : '';
$returnmsg = "Access to $machine successfully added$ttlmsg";
@ -708,7 +714,13 @@ sub access_modify {
if (open(my $fh_file, '>', $file)) {
print $fh_file $newFile;
close($fh_file);
my $machine = OVH::Bastion::machine_display(ip => $ip, port => $port, user => $user)->value;
my $machine = OVH::Bastion::machine_display(
ip => $ip,
port => $port,
user => $user,
proxyIp => $proxyIp,
proxyPort => $proxyPort
)->value;
$returnmsg = "Access to $machine successfully removed";
}
else {

Loading…
Cancel
Save