Leosac  0.8.0
Open Source Access Control
AuthFileModule.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014-2016 Leosac
3 
4  This file is part of Leosac.
5 
6  Leosac is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Affero General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Leosac is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Affero General Public License for more details.
15 
16  You should have received a copy of the GNU Affero General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #pragma once
21 
22 #include "AuthFileInstance.hpp"
23 #include "modules/BaseModule.hpp"
24 #include <boost/property_tree/ptree.hpp>
25 #include <vector>
26 #include <zmqpp/zmqpp.hpp>
27 
28 namespace Leosac
29 {
30 namespace Module
31 {
32 namespace Auth
33 {
34 class AuthFileInstance;
35 
42 class AuthFileModule : public BaseModule
43 {
44  public:
45  AuthFileModule(zmqpp::context &ctx, zmqpp::socket *pipe,
46  const boost::property_tree::ptree &cfg, CoreUtilsPtr utils);
47 
48  AuthFileModule(const AuthFileModule &) = delete;
49 
51 
52  protected:
56  virtual void dump_additional_config(zmqpp::message *out) const override;
57 
58  private:
64  void process_config();
65 
69  std::vector<AuthFileInstancePtr> authenticators_;
70 };
71 }
72 }
73 }
Leosac::Module::BaseModule
Base class for module implementation.
Definition: BaseModule.hpp:110
BaseModule.hpp
Leosac::Module::Auth::AuthFileModule::~AuthFileModule
~AuthFileModule()
Definition: AuthFileModule.cpp:41
Leosac
This is the header file for a generated source file, GitSHA1.cpp.
Definition: APIStatusCode.hpp:22
Leosac::Module::Auth::AuthFileModule::process_config
void process_config()
Processing the configuration tree, spawning AuthFileInstance object as described in the configuration...
Definition: AuthFileModule.cpp:45
Leosac::Module::Auth::AuthFileModule::AuthFileModule
AuthFileModule(zmqpp::context &ctx, zmqpp::socket *pipe, const boost::property_tree::ptree &cfg, CoreUtilsPtr utils)
Definition: AuthFileModule.cpp:27
Leosac::Module::Auth::AuthFileModule::authenticators_
std::vector< AuthFileInstancePtr > authenticators_
Authenticator instance.
Definition: AuthFileModule.hpp:69
Leosac::Module::Auth::AuthFileModule::dump_additional_config
virtual void dump_additional_config(zmqpp::message *out) const override
We have one config file per authenticator object.
Definition: AuthFileModule.cpp:76
Leosac::Module::Auth::AuthFileModule
This implements a authentication module that use files to store access permissions.
Definition: AuthFileModule.hpp:42
Leosac::CoreUtilsPtr
std::shared_ptr< CoreUtils > CoreUtilsPtr
Definition: LeosacFwd.hpp:35
AuthFileInstance.hpp