rublon-ssh-old/PAM/ssh/include/rublon/rublon.hpp
2024-06-17 14:41:07 +02:00

32 lines
675 B
C++
Executable File

#pragma once
#include "tl/expected.hpp"
#include <rublon/bits.hpp>
#include <rublon/session.hpp>
#include <rublon/json.hpp>
#include <rublon/finish.hpp>
namespace rublon {
class RublonFactory{
public:
tl::expected<Session, Error> startSession(const Pam_t &pam){
details::initLog();
auto config = ConfigurationFactory{}.systemConfig();
if(not config.has_value()) {
pam.print("The configuration file does not exist or contains incorrect values");
return tl::unexpected{ConfigurationError{}};
}
return Session{pam, config.value()};
}
};
} // namespace rublon
#include <rublon/init.hpp>