diff --git a/conanfile.py b/conanfile.py index 35b361391..868e71c02 100644 --- a/conanfile.py +++ b/conanfile.py @@ -10,15 +10,15 @@ class SeedCppConan(ConanFile): license = "MIT" generators = "cmake_find_package" settings = "os", "compiler", "build_type", "arch" - options = {"boost": ["1.67.0"], "OpenSSL": ["1.0.2n"], "gtest": ["1.8.1"]} - default_options = {"boost": "1.67.0", "OpenSSL":"1.0.2n", "gtest":"1.8.1"} + options = {"boost": ["1.67.0", "1.72.0", "1.75.0"], "openssl": ["1.1.1g", "1.1.1k"], "gtest": ["1.8.1", "1.10.0"]} + default_options = {"boost": "1.72.0", "openssl":"1.1.1k", "gtest":"1.10.0"} def configure(self): self.options["DbSQLiteAdapter"].boost = self.options.boost self.options["BoostAsioWebServerAdapter"].boost = self.options.boost - self.options["BoostAsioWebServerAdapter"].OpenSSL = self.options.OpenSSL - self.options["JWTUtils"].OpenSSL = self.options.OpenSSL - self.options["RESTAPICore"].OpenSSL = self.options.OpenSSL + self.options["BoostAsioWebServerAdapter"].openssl = self.options.openssl + self.options["JWTUtils"].openssl = self.options.openssl + self.options["RESTAPICore"].openssl = self.options.openssl self.options["JSONSettings"].boost = self.options.boost self.options["DbAdapterTestUtilities"].gtest = self.options.gtest @@ -28,21 +28,21 @@ def configure(self): self.options["JSONSettingsTestUtilities"].gtest = self.options.gtest def requirements(self): - self.requires("DbSQLiteAdapter/1.1.5@systelab/stable") - self.requires("RapidJSONAdapter/1.0.4@systelab/stable") - self.requires("BoostAsioWebServerAdapter/1.0.2@systelab/stable") - self.requires("JWTUtils/1.0.4@systelab/stable") - self.requires("RESTAPICore/1.0.3@systelab/stable") - self.requires("JSONSettings/1.0.2@systelab/stable") + self.requires("DbSQLiteAdapter/1.1.10@systelab/stable") + self.requires("RapidJSONAdapter/1.1.3@systelab/stable") + self.requires("BoostAsioWebServerAdapter/1.1.5@systelab/stable") + self.requires("JWTUtils/1.1.7@systelab/stable") + self.requires("RESTAPICore/1.1.7@systelab/stable") + self.requires("JSONSettings/1.3.8@systelab/stable") def build_requirements(self): - self.build_requires("TestUtilitiesInterface/1.0.3@systelab/stable") - self.build_requires("DbAdapterTestUtilities/1.1.5@systelab/stable") - self.build_requires("JSONAdapterTestUtilities/1.0.4@systelab/stable") - self.build_requires("JWTUtilsTestUtilities/1.0.4@systelab/stable") - self.build_requires("JSONSettingsTestUtilities/1.0.2@systelab/stable") - self.build_requires("gtest/1.8.1@bincrafters/stable") - + self.build_requires("TestUtilitiesInterface/1.0.7@systelab/stable") + self.build_requires("DbAdapterTestUtilities/1.1.12@systelab/stable") + self.build_requires("JSONAdapterTestUtilities/1.1.3@systelab/stable") + self.build_requires("JWTUtilsTestUtilities/1.1.7@systelab/stable") + self.build_requires("JSONSettingsTestUtilities/1.3.8@systelab/stable") + self.build_requires("gtest/1.10.0") + def imports(self): self.copy("*.dll", dst=("bin/SeedCpp/%s" % self.settings.build_type), src="bin") self.copy("*.dll", dst=("bin/SeedCppCoreUnitTest/%s" % self.settings.build_type), src="bin") diff --git a/src/SeedCpp/CMakeLists.txt b/src/SeedCpp/CMakeLists.txt index 12e1f01d9..161b9a397 100644 --- a/src/SeedCpp/CMakeLists.txt +++ b/src/SeedCpp/CMakeLists.txt @@ -11,7 +11,7 @@ set(SEED_CPP_PROJECT SeedCpp) file(GLOB_RECURSE SEED_CPP_PROJECT_SRC "*.cpp") file(GLOB_RECURSE SEED_CPP_PROJECT_HDR "*.h") add_executable(${SEED_CPP_PROJECT} ${SEED_CPP_PROJECT_SRC} ${SEED_CPP_PROJECT_HDR}) -target_link_libraries(${SEED_CPP_PROJECT} SeedCppCore boost::boost) +target_link_libraries(${SEED_CPP_PROJECT} SeedCppCore Boost::boost) set_target_properties(${SEED_CPP_PROJECT} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${SEED_CPP_PROJECT}) #Configure source groups diff --git a/src/SeedCppCore/CMakeLists.txt b/src/SeedCppCore/CMakeLists.txt index 463f02a5a..fdc88b89d 100644 --- a/src/SeedCppCore/CMakeLists.txt +++ b/src/SeedCppCore/CMakeLists.txt @@ -1,6 +1,7 @@ cmake_minimum_required(VERSION 3.2) # Find external dependencies +find_package(Boost) find_package(DbSQLiteAdapter) find_package(RapidJSONAdapter) find_package(BoostAsioWebServerAdapter) @@ -17,6 +18,7 @@ file(GLOB_RECURSE SEED_CPP_CORE_SRC "*.cpp") file(GLOB_RECURSE SEED_CPP_CORE_HDR "*.h") add_library(${SEED_CPP_CORE} STATIC ${SEED_CPP_CORE_SRC} ${SEED_CPP_CORE_HDR}) target_link_libraries(${SEED_CPP_CORE} + Boost::boost DbSQLiteAdapter::DbSQLiteAdapter RapidJSONAdapter::RapidJSONAdapter BoostAsioWebServerAdapter::BoostAsioWebServerAdapter diff --git a/src/SeedCppCore/REST/RouteAccess/RouteAccessValidatorsFactory.cpp b/src/SeedCppCore/REST/RouteAccess/RouteAccessValidatorsFactory.cpp index b03a03551..3cca642d4 100644 --- a/src/SeedCppCore/REST/RouteAccess/RouteAccessValidatorsFactory.cpp +++ b/src/SeedCppCore/REST/RouteAccess/RouteAccessValidatorsFactory.cpp @@ -10,6 +10,8 @@ #include "RESTAPICore/RouteAccess/TokenExpirationAccessValidator.h" #include "RESTAPICore/RouteAccess/UserRoleRouteAccessValidator.h" +#include "TimeAdapter/TimeAdapter.h" + namespace seed_cpp { namespace rest { @@ -23,9 +25,9 @@ namespace seed_cpp { namespace rest { std::unique_ptr RouteAccessValidatorsFactory::buildTokenExpirationRouteAccessValidator() const { long expirationSeconds = 600; // 10 minutes - auto& epochTimeService = m_context.getServicesMgr()->getSystemServicesMgr().getEpochTimeService(); + systelab::time::TimeAdapter timeAdapter; - return std::make_unique(expirationSeconds, epochTimeService); + return std::make_unique(timeAdapter, expirationSeconds); }; std::unique_ptr RouteAccessValidatorsFactory::buildAdminRoleRouteAccessValidator() const diff --git a/src/SeedCppCore/Services/System/SystemServicesFactory.cpp b/src/SeedCppCore/Services/System/SystemServicesFactory.cpp index 393498f32..94d268d7f 100644 --- a/src/SeedCppCore/Services/System/SystemServicesFactory.cpp +++ b/src/SeedCppCore/Services/System/SystemServicesFactory.cpp @@ -9,6 +9,8 @@ #include "JSONSettings/SettingsService.h" #include "RESTAPICore/RouteAccess/EpochTimeService.h" +#include "TimeAdapter/TimeAdapter.h" + namespace seed_cpp { namespace service { @@ -31,7 +33,9 @@ namespace seed_cpp { namespace service { std::unique_ptr SystemServicesFactory::buildEpochTimeService() const { - return std::make_unique(); + systelab::time::TimeAdapter TimeAdapter; + + return std::make_unique(TimeAdapter); } std::unique_ptr SystemServicesFactory::buildUUIDGeneratorService() const diff --git a/test/DatabaseIntegrationTest/CMakeLists.txt b/test/DatabaseIntegrationTest/CMakeLists.txt index b75ec455b..0d1fb1fc4 100644 --- a/test/DatabaseIntegrationTest/CMakeLists.txt +++ b/test/DatabaseIntegrationTest/CMakeLists.txt @@ -17,7 +17,7 @@ file(GLOB_RECURSE DATABASE_INTEGRATION_TEST_PROJECT_SRC "*.cpp") file(GLOB_RECURSE DATABASE_INTEGRATION_TEST_PROJECT_HDR "*.h") file(GLOB_RECURSE DATABASE_INTEGRATION_TEST_PROJECT_SQL "*.sql") add_executable(${DATABASE_INTEGRATION_TEST_PROJECT} ${DATABASE_INTEGRATION_TEST_PROJECT_SRC} ${DATABASE_INTEGRATION_TEST_PROJECT_HDR} ${DATABASE_INTEGRATION_TEST_PROJECT_SQL}) -target_link_libraries(${DATABASE_INTEGRATION_TEST_PROJECT} SeedCppCore SeedCppCoreTestUtilities gtest::gtest) +target_link_libraries(${DATABASE_INTEGRATION_TEST_PROJECT} SeedCppCore SeedCppCoreTestUtilities GTest::gtest) set_target_properties(${DATABASE_INTEGRATION_TEST_PROJECT} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/${DATABASE_INTEGRATION_TEST_PROJECT}) # Ignored missing PDBs link warning on Visual Studio diff --git a/test/SeedCppCoreTestUtilities/CMakeLists.txt b/test/SeedCppCoreTestUtilities/CMakeLists.txt index 5a6e2119c..625ba89e0 100644 --- a/test/SeedCppCoreTestUtilities/CMakeLists.txt +++ b/test/SeedCppCoreTestUtilities/CMakeLists.txt @@ -13,7 +13,7 @@ set(SEED_CPP_CORE_TEST_UTILITIES SeedCppCoreTestUtilities) file(GLOB_RECURSE SEED_CPP_CORE_TEST_UTILITIES_SRC "*.cpp") file(GLOB_RECURSE SEED_CPP_CORE_TEST_UTILITIES_HDR "*.h") add_library(${SEED_CPP_CORE_TEST_UTILITIES} STATIC ${SEED_CPP_CORE_TEST_UTILITIES_SRC} ${SEED_CPP_CORE_TEST_UTILITIES_HDR}) -target_link_libraries(${SEED_CPP_CORE_TEST_UTILITIES} SeedCppCore gtest::gtest TestUtilitiesInterface::TestUtilitiesInterface) +target_link_libraries(${SEED_CPP_CORE_TEST_UTILITIES} SeedCppCore GTest::gtest TestUtilitiesInterface::TestUtilitiesInterface) #Configure source groups foreach(FILE ${SEED_CPP_CORE_TEST_UTILITIES_SRC} ${SEED_CPP_CORE_TEST_UTILITIES_HDR}) diff --git a/test/SeedCppCoreUnitTest/CMakeLists.txt b/test/SeedCppCoreUnitTest/CMakeLists.txt index 9f2ad8abc..6819e9c5e 100644 --- a/test/SeedCppCoreUnitTest/CMakeLists.txt +++ b/test/SeedCppCoreUnitTest/CMakeLists.txt @@ -22,7 +22,7 @@ file(GLOB_RECURSE SEED_CPP_CORE_UNIT_TEST_PROJECT_SRC "*.cpp") file(GLOB_RECURSE SEED_CPP_CORE_UNIT_TEST_PROJECT_HDR "*.h") add_executable(${SEED_CPP_CORE_UNIT_TEST_PROJECT} ${SEED_CPP_CORE_UNIT_TEST_PROJECT_SRC} ${SEED_CPP_CORE_UNIT_TEST_PROJECT_HDR}) target_link_libraries(${SEED_CPP_CORE_UNIT_TEST_PROJECT} SeedCppCore SeedCppCoreTestUtilities - gtest::gtest + GTest::gtest DbAdapterTestUtilities::DbAdapterTestUtilities JSONAdapterTestUtilities::JSONAdapterTestUtilities JWTUtilsTestUtilities::JWTUtilsTestUtilities