/* Copyright (C) CJ Affiliate * * You may use, distribute and modify this code under the * terms of the GNU General Public License version 2 or * later. * * You should have received a copy of the license with this * file. If not, you will find a copy in the "LICENSE" file * at https://github.com/cjdev/dual-control. */ #ifndef INSTALLER_H_ #define INSTALLER_H_ #include #include #include #include #include "token.h" #include "sys_unistd.h" #include "user.h" #include "generator.h" class installer_ifc { public: virtual std::pair install_key() const { return {"AAAA", "123456"}; } }; class installer { public: using delegate = std::shared_ptr; private: delegate delegate_; public: installer (const delegate &delegate = std::make_shared()) : delegate_ (delegate) {} std::pair install_key() const { return delegate_->install_key(); } static installer create (const tokens &tokens, const unistd &unistd, const directory &directory, const totp_generator &generator); }; #endif