mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-08-26 16:46:41 +00:00
fix(credentials): audit delegated certificate signing
This commit is contained in:
@@ -96,6 +96,13 @@ sub process_request
|
||||
$callback->({ error => ["Unable to sign certificate for $node"], errorcode => [1] });
|
||||
return;
|
||||
}
|
||||
my $peer = $request->{'_xcat_clientip'}
|
||||
? $request->{'_xcat_clientip'}->[0]
|
||||
: $request->{'_xcat_clienthost'}
|
||||
? $request->{'_xcat_clienthost'}->[0]
|
||||
: $request->{'_xcat_clientfqdn'}->[0];
|
||||
xCAT::MsgUtils->trace(0, 'I',
|
||||
"credentials: signed certificate for $node requested by $peer");
|
||||
$callback->({ data => [{ content => [$certificate], desc => ['x509cert'] }] });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -342,6 +342,7 @@ is( $error, 'The management node is not configured',
|
||||
'missing site.master has a specific error' );
|
||||
|
||||
$xCAT::Table::servicenode = 'service-a';
|
||||
@xCAT::MsgUtils::messages = ();
|
||||
my @callback;
|
||||
{
|
||||
no warnings 'redefine';
|
||||
@@ -374,6 +375,16 @@ is_deeply(
|
||||
],
|
||||
'authorized delegated request returns only the signed certificate'
|
||||
);
|
||||
is_deeply(
|
||||
$xCAT::MsgUtils::messages[-1],
|
||||
[
|
||||
'xCAT::MsgUtils',
|
||||
0,
|
||||
'I',
|
||||
'credentials: signed certificate for compute-01 requested by 192.0.2.21',
|
||||
],
|
||||
'successful delegated signing records the node and service node address'
|
||||
);
|
||||
|
||||
@callback = ();
|
||||
xCAT_plugin::credentials::process_request(
|
||||
|
||||
Reference in New Issue
Block a user