bwi/v2.3.0 #29
@ -55,6 +55,7 @@ class Status {
|
||||
std::string_view _appTypeKey = "/type";
|
||||
std::string_view _paramSystemName = "/params/os";
|
||||
std::string_view _paramSSHDBase = "/params/sshd_config/";
|
||||
std::string_view _configBase = "/config/";
|
||||
|
||||
public:
|
||||
Status() : _alloc{}, _data{&_alloc}, _statusUpdated{false} {
|
||||
@ -95,7 +96,7 @@ class Status {
|
||||
|
||||
void updateSSHDConfig() {
|
||||
using namespace std::string_view_literals;
|
||||
constexpr auto keys = make_array<std::string_view>("authenticationmethods"sv,
|
||||
constexpr auto keys = make_array< std::string_view >("authenticationmethods"sv,
|
||||
"challengeresponseauthentication"sv,
|
||||
"kbdinteractiveauthentication"sv,
|
||||
"logingracetime"sv,
|
||||
@ -171,7 +172,7 @@ class CheckApplication {
|
||||
|
||||
public:
|
||||
tl::expected< int, Error > call(const CoreHandler_t & coreHandler, std::string_view systemToken) const {
|
||||
memory::MonotonicStack_1k_Resource mr;
|
||||
memory::MonotonicStack_2k_Resource mr;
|
||||
RapidJSONPMRAlloc alloc{&mr};
|
||||
constexpr std::string_view api = "/api/app/init";
|
||||
Status status;
|
||||
@ -181,6 +182,7 @@ class CheckApplication {
|
||||
status.updateAppVersion(RUBLON_VERSION_STRING);
|
||||
status.updateSystemVersion(details::osName(&mr));
|
||||
status.updateSSHDConfig();
|
||||
status.updateRublonConfig();
|
||||
|
||||
if(status.updated()) {
|
||||
auto & alloc = status.data().GetAllocator();
|
||||
|
||||
@ -60,7 +60,7 @@ class Init : public AuthenticationStep {
|
||||
params.AddMember("appVer", RUBLON_VERSION_STRING, alloc);
|
||||
if(not host.empty())
|
||||
params.AddMember("hostName", Value{os.c_str(), static_cast< unsigned >(host.size()), alloc}, alloc);
|
||||
if(not _session.inInteractiveMode())
|
||||
if(_session.inNonInteractiveMode())
|
||||
params.AddMember("mode", "noninteractive", alloc);
|
||||
params.AddMember("os", Value{os.c_str(), static_cast< unsigned >(os.size()), alloc}, alloc);
|
||||
params.AddMember("userIP", Value{pam.ip().get(), alloc}, alloc);
|
||||
|
||||
@ -130,7 +130,11 @@ class Session : public DefaultResource {
|
||||
return systemToken().data();
|
||||
}
|
||||
|
||||
bool inInteractiveMode() const {
|
||||
constexpr bool inNonInteractiveMode() const {
|
||||
return not inInteractiveMode();
|
||||
}
|
||||
|
||||
constexpr bool inInteractiveMode() const {
|
||||
return _config.nonInteractiveMode == false;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user