use PVE::SafeSyslog;
use PVE::RPCEnvironment;
use PVE::Cluster qw(cfs_read_file);
+use PVE::Corosync;
use PVE::RESTHandler;
use PVE::AccessControl;
use PVE::JSONSchema qw(get_standard_option);
username => { type => 'string' },
ticket => { type => 'string', optional => 1},
CSRFPreventionToken => { type => 'string', optional => 1 },
+ clustername => { type => 'string', optional => 1 },
}
},
code => sub {
$res->{cap} = &$compute_api_permission($rpcenv, $username);
+ if (PVE::Corosync::check_conf_exists(1)) {
+ if ($rpcenv->check($username, '/', ['Sys.Audit'], 1)) {
+ my $conf = cfs_read_file('corosync.conf');
+ my $totem = PVE::Corosync::totem_config($conf);
+ if ($totem->{cluster_name}) {
+ $res->{clustername} = $totem->{cluster_name};
+ }
+ }
+ }
+
PVE::Cluster::log_msg('info', 'root@pam', "successful auth for user '$username'");
return $res;