rublon-ssh/PAM/ssh/include/rublon/rublon.hpp
rublon-bwi 0934902bba
Bwi/v2.3.0 (#17)
* Add base PROXY support implementation

* Remove some dynamic memory allocations

* Rewrite configuration reading module

* Make everything in core connector memory resource aware

* Add logs to check is proxy is used

* Add a proxy fallback, and read proxy from env

* Add config entry to check application

* Cleanup includes

* Ddd configuration dump to check application

* Update rhel8 packages

* Fix http headers bug when using proxy server

* Fix formatting

* Fix bad optional access

* Fix configuration check regresion

* Fix memory management issue, remove strict allocators and make connector more polite to memory overflow errors

* Fix initialization of core handler
2025-07-18 11:48:18 +02:00

33 lines
966 B
C++
Executable File

#pragma once
#include "rublon/memory.hpp"
#include <tl/expected.hpp>
#include <rublon/bits.hpp>
#include <rublon/finish.hpp>
#include <rublon/json.hpp>
#include <rublon/session.hpp>
namespace rublon {
class RublonFactory {
public:
tl::expected< void, Error > initializeSession(Session & session) {
log(LogLevel::Debug, "Configuration read start");
memory::MonotonicStack_2k_Resource memory_resource;
ConfigurationReader reader{&memory_resource, "/etc/rublon.config"};
if(auto ok = reader.applyTo(session.config()); not ok.has_value()) {
log(LogLevel::Warning, "Configuration contains errors");
session.pam().print("The configuration file does not exist or contains incorrect values");
return tl::unexpected{ConfigurationError{}};
}
log(LogLevel::Debug, "Configuration read success");
return {};
}
};
} // namespace rublon
#include <rublon/init.hpp>