validator: integrate validator-config

Validation of interest is done. Validation of data will be implemented in future commit.

Change-Id: I2c03172c6e0dfa9ec0c6cffa59999ecb30030243
refs #1479
diff --git a/src/repo.cpp b/src/repo.cpp
index 2c6f3b0..d868508 100644
--- a/src/repo.cpp
+++ b/src/repo.cpp
@@ -44,9 +44,9 @@
   ptree repoConf = propertyTree.get_child("repo");
 
   RepoConfig repoConfig;
+  repoConfig.repoConfigPath = configPath;
 
   ptree dataConf = repoConf.get_child("data");
-
   for (ptree::const_iterator it = dataConf.begin();
        it != dataConf.end();
        ++it)
@@ -112,17 +112,13 @@
   , m_scheduler(ioService)
   , m_face(ioService)
   , m_storageHandle(openStorage(config))
+  , m_validator(m_face)
   , m_readHandle(m_face, *m_storageHandle, m_keyChain, m_scheduler)
   , m_writeHandle(m_face, *m_storageHandle, m_keyChain, m_scheduler, m_validator)
   , m_deleteHandle(m_face, *m_storageHandle, m_keyChain, m_scheduler, m_validator)
   , m_tcpBulkInsertHandle(ioService, *m_storageHandle)
 
 {
-  //Trust model not implemented, this is just an empty validator
-  //@todo add a function to parse RepoConfig.validatorNode and define the trust model
-  m_validator.addInterestRule("^<>",
-                              *m_keyChain.
-                              getCertificate(m_keyChain.getDefaultCertificateName()));
 }
 
 shared_ptr<StorageHandle>
@@ -161,4 +157,10 @@
     }
 }
 
+void
+Repo::enableValidation()
+{
+  m_validator.load(m_config.validatorNode, m_config.repoConfigPath);
+}
+
 } // namespace repo