-
Notifications
You must be signed in to change notification settings - Fork 2
Update seed dependencies #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
a5f7a4e
98722d0
989d7f2
87a6911
b6880ca
a360817
1bb0296
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
cmake_minimum_required(VERSION 3.2) | ||
|
||
# Find external dependencies | ||
find_package(Boost) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New packages shouldn't be required because they are transitive dependencies of existing packages. I think previous version of this file should be kept. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree not to add the new packages, but the conversion from boost to Boost is necessary |
||
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 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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<IRouteAccessValidator> RouteAccessValidatorsFactory::buildTokenExpirationRouteAccessValidator() const | ||
{ | ||
long expirationSeconds = 600; // 10 minutes | ||
auto& epochTimeService = m_context.getServicesMgr()->getSystemServicesMgr().getEpochTimeService(); | ||
systelab::time::TimeAdapter timeAdapter; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The TimeAdapter shouldn't be declared as a local variable because it is injected to the service being built, but it will be destroyed once exiting the factory method. Thus, this will cause a crash when accessing to an object that has been destroyed from the service. Thus, I would suggest defining the TimeAdapter as part of the context, as we do with other adapters (i.e db adapter). Moreover, it should be injected on constructor of the Context object and as an interface (ITimeAdapter), so we allow using a mock version of it (we are not assuming to have always the real implementation). |
||
|
||
return std::make_unique<TokenExpirationAccessValidator>(expirationSeconds, epochTimeService); | ||
return std::make_unique<TokenExpirationAccessValidator>(timeAdapter, expirationSeconds); | ||
}; | ||
|
||
std::unique_ptr<IRouteAccessValidator> RouteAccessValidatorsFactory::buildAdminRoleRouteAccessValidator() const | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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<systelab::rest_api_core::IEpochTimeService> SystemServicesFactory::buildEpochTimeService() const | ||
{ | ||
return std::make_unique<systelab::rest_api_core::EpochTimeService>(); | ||
systelab::time::TimeAdapter TimeAdapter; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After the change on REST API core to not require an epoch service to build a TokenExpirationAccessValidator, I think that this method is not used anywhere else. If that's the case, I would get rid of this factory method. |
||
|
||
return std::make_unique<systelab::rest_api_core::EpochTimeService>(TimeAdapter); | ||
} | ||
|
||
std::unique_ptr<IUUIDGeneratorService> SystemServicesFactory::buildUUIDGeneratorService() const | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version of google test package should be gathered from the options considering that now there are multiple values (1.10.0 and 1.8.1).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the options, it is contemplated to use version 1.8.1 or 1.10.0. Version 1.10.0 is required since the rest of the dependencies use it