Merge branch 'bwi/v2.2.0' of http://192.168.68.6:3001/bartoszek/rublon-ssh into bwi/v2.2.0
This commit is contained in:
commit
a480838103
@ -27,6 +27,7 @@ class Configuration {
|
||||
bool logging{};
|
||||
bool autopushPrompt{};
|
||||
FailMode failMode{};
|
||||
bool nonInteractiveMode{};
|
||||
};
|
||||
|
||||
namespace {
|
||||
@ -138,7 +139,7 @@ constexpr auto make_entry(const char * name, const char * defaultValue) {
|
||||
return Entry{name, defaultValue, Entry::make_read_function< member >()};
|
||||
}
|
||||
|
||||
constexpr static inline std::array< Entry, 8 > configurationVariables = { //
|
||||
constexpr static inline std::array< Entry, 9 > configurationVariables = { //
|
||||
make_entry< &Configuration::logging >("logging", "true"),
|
||||
make_entry< &Configuration::systemToken >("systemToken", nullptr),
|
||||
make_entry< &Configuration::secretKey >("secretKey", nullptr),
|
||||
@ -146,7 +147,9 @@ constexpr static inline std::array< Entry, 8 > configurationVariables = { //
|
||||
make_entry< &Configuration::prompt >("prompt", "1"),
|
||||
make_entry< &Configuration::enablePasswdEmail >("enablePasswdEmail", "true"),
|
||||
make_entry< &Configuration::autopushPrompt >("autopushPrompt", "false"),
|
||||
make_entry< &Configuration::failMode >("failMode", "deny")};
|
||||
make_entry< &Configuration::failMode >("failMode", "deny"),
|
||||
make_entry< &Configuration::nonInteractiveMode >("nonInteractiveMode", "false")
|
||||
};
|
||||
|
||||
class ConfigurationFactory {
|
||||
public:
|
||||
|
||||
@ -21,7 +21,7 @@ class RublonFactory {
|
||||
return tl::unexpected{ConfigurationError{}};
|
||||
}
|
||||
|
||||
return Session{pam, config.value(), true};
|
||||
return Session{pam, config.value()};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -17,14 +17,12 @@ class Session {
|
||||
std::pmr::string _tid;
|
||||
std::pmr::string _accessToken;
|
||||
|
||||
bool _interactiveMode;
|
||||
|
||||
CoreHandler_t _coreHandler;
|
||||
/// TODO log
|
||||
/// TODO momory resource
|
||||
public:
|
||||
Session(const Pam_t & pam, const Configuration & config, bool interactive = true)
|
||||
: _pam{pam}, _config{config}, _interactiveMode{interactive}, _coreHandler{_config} {
|
||||
Session(const Pam_t & pam, const Configuration & config)
|
||||
: _pam{pam}, _config{config}, _coreHandler{_config} {
|
||||
log(LogLevel::Debug, __PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
@ -52,7 +50,7 @@ class Session {
|
||||
}
|
||||
|
||||
bool inInteractiveMode() const {
|
||||
return _interactiveMode;
|
||||
return _config.nonInteractiveMode == false;
|
||||
}
|
||||
|
||||
void updateTransactionId(const Value * tid) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user