mirror of
https://github.com/ovh/the-bastion.git
synced 2025-09-04 12:04:11 +08:00
enh: groupInfo: nicer message when no egress key exists
This commit is contained in:
parent
3b37242317
commit
7eeccb7c5d
2 changed files with 6 additions and 3 deletions
|
@ -59,7 +59,7 @@ if (!$mfaRequired && !defined $ttl) {
|
|||
|
||||
#<HEADER
|
||||
|
||||
#>PARAMS:ACCOUNT
|
||||
#>PARAMS:GROUP
|
||||
$fnret = OVH::Bastion::is_valid_group_and_existing(group => $group, groupType => "key");
|
||||
$fnret or HEXIT($fnret);
|
||||
|
||||
|
@ -67,7 +67,7 @@ $fnret or HEXIT($fnret);
|
|||
$group = $fnret->value->{'group'};
|
||||
my $shortGroup = $fnret->value->{'shortGroup'};
|
||||
|
||||
#<PARAMS:ACCOUNT
|
||||
#<PARAMS:GROUP
|
||||
|
||||
#>RIGHTSCHECK
|
||||
if ($self eq 'root') {
|
||||
|
|
|
@ -185,7 +185,10 @@ if ($fnret) {
|
|||
$fnret = OVH::Bastion::get_group_keys(group => $group);
|
||||
if ($fnret and $from) {
|
||||
osh_info ' ';
|
||||
if (@{$fnret->value->{'sortedKeys'}} == 1) {
|
||||
if ($fnret->value && !@{$fnret->value->{'sortedKeys'}}) {
|
||||
osh_info "This group has no SSH egress key, the owner may use groupGenerateEgressKey to generate one.";
|
||||
}
|
||||
elsif (@{$fnret->value->{'sortedKeys'}} == 1) {
|
||||
osh_info "The public key of this group is:";
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Reference in a new issue