command-authenticator.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26 #ifndef NFD_DAEMON_MGMT_COMMAND_AUTHENTICATOR_HPP
27 #define NFD_DAEMON_MGMT_COMMAND_AUTHENTICATOR_HPP
28 
29 #include "core/config-file.hpp"
30 #include <ndn-cxx/mgmt/dispatcher.hpp>
31 
32 namespace ndn {
33 namespace security {
34 namespace v2 {
35 class Validator;
36 } // namespace v2
37 } // namespace security
38 } // namespace ndn
39 
40 namespace nfd {
41 
44 class CommandAuthenticator : public enable_shared_from_this<CommandAuthenticator>, noncopyable
45 {
46 public:
47  static shared_ptr<CommandAuthenticator>
48  create();
49 
50  void
51  setConfigFile(ConfigFile& configFile);
52 
58  ndn::mgmt::Authorization
59  makeAuthorization(const std::string& module, const std::string& verb);
60 
61 private:
63 
67  void
68  processConfig(const ConfigSection& section, bool isDryRun, const std::string& filename);
69 
70 private:
72  std::unordered_map<std::string, shared_ptr<ndn::security::v2::Validator>> m_validators;
73 };
74 
75 } // namespace nfd
76 
77 #endif // NFD_DAEMON_MGMT_COMMAND_AUTHENTICATOR_HPP
Copyright (c) 2014-2017, Regents of the University of California, Arizona Board of Regents...
configuration file parsing utility
Definition: config-file.hpp:58
void setConfigFile(ConfigFile &configFile)
provides ControlCommand authorization according to NFD configuration file
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
Definition: algorithm.hpp:32
boost::property_tree::ptree ConfigSection
a config file section
Definition: config-file.hpp:37