chore: perl tidy

pull/592/head
jon4hz 3 months ago
parent 97cbea114f
commit a471dc055d
No known key found for this signature in database
GPG Key ID: 4B0AFE9E7118898E

@ -65,8 +65,7 @@ $fnret or main_exit(OVH::Bastion::EXIT_CONFIGURATION_FAILURE, "configuration_fai
my $config = $fnret->value;
if ($action eq 'add' && $proxyIp && !$config->{'egressProxyJumpAllowed'}) {
HEXIT('ERR_INVALID_PARAMETER',
msg => "ProxyJump egress connections are disabled by policy");
HEXIT('ERR_INVALID_PARAMETER', msg => "ProxyJump egress connections are disabled by policy");
}
# access_modify validates all its parameters, don't do it ourselves here for clarity

@ -92,8 +92,7 @@ $fnret or main_exit(OVH::Bastion::EXIT_CONFIGURATION_FAILURE, "configuration_fai
my $config = $fnret->value;
if ($action eq 'add' && $proxyIp && !$config->{'egressProxyJumpAllowed'}) {
HEXIT('ERR_INVALID_PARAMETER',
msg => "ProxyJump egress connections are disabled by policy");
HEXIT('ERR_INVALID_PARAMETER', msg => "ProxyJump egress connections are disabled by policy");
}
my $machine = OVH::Bastion::machine_display(

@ -97,8 +97,7 @@ $fnret or main_exit(OVH::Bastion::EXIT_CONFIGURATION_FAILURE, "configuration_fai
my $config = $fnret->value;
if ($action eq 'add' && $proxyIp && !$config->{'egressProxyJumpAllowed'}) {
HEXIT('ERR_INVALID_PARAMETER',
msg => "ProxyJump egress connections are disabled by policy");
HEXIT('ERR_INVALID_PARAMETER', msg => "ProxyJump egress connections are disabled by policy");
}
my $machine = OVH::Bastion::machine_display(

@ -14,18 +14,18 @@ my $remainingOptions = OVH::Bastion::Plugin::begin(
argv => \@ARGV,
header => "your past sessions list",
options => {
"detailed" => \my $detailed,
"id=s" => \my $id,
"type=s" => \my $type,
"allowed" => \my $allowed,
"denied" => \my $denied,
"after=s" => \my $after,
"before=s" => \my $before,
"from=s" => \my $from,
"via=s" => \my $via,
"via-port=i" => \my $viaPort,
"to-port=i" => \my $toPort,
"limit=i" => \my $limit,
"detailed" => \my $detailed,
"id=s" => \my $id,
"type=s" => \my $type,
"allowed" => \my $allowed,
"denied" => \my $denied,
"after=s" => \my $after,
"before=s" => \my $before,
"from=s" => \my $from,
"via=s" => \my $via,
"via-port=i" => \my $viaPort,
"to-port=i" => \my $toPort,
"limit=i" => \my $limit,
"proxy-user=s" => \my $proxyUser,
"proxy-ip=s" => \my $proxyIp,
"proxy-port=i" => \my $proxyPort,

@ -19,11 +19,11 @@ my $remainingOptions = OVH::Bastion::Plugin::begin(
"proxy-port=s" => \my $proxyPort,
"proxy-user=s" => \my $proxyUser,
# undocumented/compatibility:
"user-any" => \my $userAny,
"port-any" => \my $portAny,
"scpup" => \my $scpUp,
"scpdown" => \my $scpDown,
"sftp" => \my $sftp,
"user-any" => \my $userAny,
"port-any" => \my $portAny,
"scpup" => \my $scpUp,
"scpdown" => \my $scpDown,
"sftp" => \my $sftp,
},
helptext => <<'EOF',
Remove a personal server access from your account

@ -275,12 +275,12 @@ osh_debug("user-passed options : $realOptions");
# special case: check if this is a ProxyJump connection that should be executed directly
if ($ENV{'OSH_PROXYJUMP_CONNECTION'}) {
delete $ENV{'OSH_PROXYJUMP_CONNECTION'}; # make sure nothing else gets interpreted as proxyjump
# check if poxyJump connections are allowed
# This condition should never be true if proxyJump isn't allowed, but let's double check
if (!$config->{'egressProxyJumpAllowed'}) {
main_exit OVH::Bastion::EXIT_ACCESS_DENIED, "proxyjump_not_allowed",
"Sorry $self, egress proxy-jump connections have been disabled by policy";
"Sorry $self, egress proxy-jump connections have been disabled by policy";
}
osh_debug("Detected ProxyJump connection, executing command directly");
@ -1601,7 +1601,7 @@ else {
# check if poxyJump connections are allowed
if (!$config->{'egressProxyJumpAllowed'}) {
main_exit OVH::Bastion::EXIT_ACCESS_DENIED, "proxyjump_not_allowed",
"Sorry $self, egress proxy-jump connections have been disabled by policy";
"Sorry $self, egress proxy-jump connections have been disabled by policy";
}
# Build ProxyCommand with same options as main SSH command

Loading…
Cancel
Save