From 5ad212cd621dc10cbfb49a5b6df53606bcd76dfa Mon Sep 17 00:00:00 2001 From: Bartosz Wieczorek Date: Fri, 21 Jul 2023 10:54:58 +0200 Subject: [PATCH] Change directory structure --- PAM/ssh/CMakeLists.txt | 22 +++++++++++-- .../{src => include/rublon}/CoreHandler.hpp | 0 .../{src => include/rublon}/configuration.hpp | 0 PAM/ssh/{src => include/rublon}/curl.hpp | 0 PAM/ssh/{src => include/rublon}/init.hpp | 0 PAM/ssh/{src => include/rublon}/json.hpp | 0 .../{src => include/rublon}/method/OTP.hpp | 0 .../{src => include/rublon}/method/SMS.hpp | 0 .../rublon}/method/method_factory.hpp | 6 ++-- PAM/ssh/{src => include/rublon}/pam.hpp | 0 .../{src => include/rublon}/pam_action.hpp | 0 PAM/ssh/{src => include/rublon}/rublon.hpp | 0 PAM/ssh/{src => include/rublon}/sign.hpp | 0 PAM/ssh/{src => include/rublon}/span.hpp | 0 PAM/ssh/{src => include/rublon}/utils.hpp | 0 PAM/ssh/lib/CMakeLists.txt | 14 ++++++++ PAM/ssh/{src => lib}/pam.cpp | 4 +-- PAM/ssh/src/CMakeLists.txt | 33 ------------------- PAM/ssh/tests/core_handler_tests.cpp | 2 +- PAM/ssh/tests/http_mock.hpp | 4 +-- PAM/ssh/tests/init_test.cpp | 2 +- PAM/ssh/tests/rublonTests.cpp | 2 +- PAM/ssh/tests/utilsTests.cpp | 2 +- 23 files changed, 44 insertions(+), 47 deletions(-) rename PAM/ssh/{src => include/rublon}/CoreHandler.hpp (100%) rename PAM/ssh/{src => include/rublon}/configuration.hpp (100%) rename PAM/ssh/{src => include/rublon}/curl.hpp (100%) rename PAM/ssh/{src => include/rublon}/init.hpp (100%) rename PAM/ssh/{src => include/rublon}/json.hpp (100%) rename PAM/ssh/{src => include/rublon}/method/OTP.hpp (100%) rename PAM/ssh/{src => include/rublon}/method/SMS.hpp (100%) rename PAM/ssh/{src => include/rublon}/method/method_factory.hpp (95%) rename PAM/ssh/{src => include/rublon}/pam.hpp (100%) rename PAM/ssh/{src => include/rublon}/pam_action.hpp (100%) rename PAM/ssh/{src => include/rublon}/rublon.hpp (100%) rename PAM/ssh/{src => include/rublon}/sign.hpp (100%) rename PAM/ssh/{src => include/rublon}/span.hpp (100%) rename PAM/ssh/{src => include/rublon}/utils.hpp (100%) create mode 100644 PAM/ssh/lib/CMakeLists.txt rename PAM/ssh/{src => lib}/pam.cpp (96%) delete mode 100644 PAM/ssh/src/CMakeLists.txt diff --git a/PAM/ssh/CMakeLists.txt b/PAM/ssh/CMakeLists.txt index 714c814..b18a4cc 100644 --- a/PAM/ssh/CMakeLists.txt +++ b/PAM/ssh/CMakeLists.txt @@ -1,9 +1,25 @@ add_subdirectory(extern/rapidjson) +include_directories(extern/rapidjson/include) -include_directories( - extern/rapidjson/include +add_library(rublon-ssh + INTERFACE + include/rublon/pam.hpp + include/rublon/rublon.hpp + include/rublon/curl.hpp + include/rublon/span.hpp + include/rublon/sign.hpp + include/rublon/CoreHandler.hpp + include/rublon/configuration.hpp ) -add_subdirectory(src) +#set(CMAKE_SHARED_LINKER_FLAGS "-fpic -static-libstdc++ -fvisibility=hidden -ffunction-sections -fdata-sections -fwhole-program") +target_include_directories(rublon-ssh + PUBLIC INTERFACE + extern + ${CMAKE_CURRENT_LIST_DIR}/include +) + + +add_subdirectory(lib) add_subdirectory(tests) diff --git a/PAM/ssh/src/CoreHandler.hpp b/PAM/ssh/include/rublon/CoreHandler.hpp similarity index 100% rename from PAM/ssh/src/CoreHandler.hpp rename to PAM/ssh/include/rublon/CoreHandler.hpp diff --git a/PAM/ssh/src/configuration.hpp b/PAM/ssh/include/rublon/configuration.hpp similarity index 100% rename from PAM/ssh/src/configuration.hpp rename to PAM/ssh/include/rublon/configuration.hpp diff --git a/PAM/ssh/src/curl.hpp b/PAM/ssh/include/rublon/curl.hpp similarity index 100% rename from PAM/ssh/src/curl.hpp rename to PAM/ssh/include/rublon/curl.hpp diff --git a/PAM/ssh/src/init.hpp b/PAM/ssh/include/rublon/init.hpp similarity index 100% rename from PAM/ssh/src/init.hpp rename to PAM/ssh/include/rublon/init.hpp diff --git a/PAM/ssh/src/json.hpp b/PAM/ssh/include/rublon/json.hpp similarity index 100% rename from PAM/ssh/src/json.hpp rename to PAM/ssh/include/rublon/json.hpp diff --git a/PAM/ssh/src/method/OTP.hpp b/PAM/ssh/include/rublon/method/OTP.hpp similarity index 100% rename from PAM/ssh/src/method/OTP.hpp rename to PAM/ssh/include/rublon/method/OTP.hpp diff --git a/PAM/ssh/src/method/SMS.hpp b/PAM/ssh/include/rublon/method/SMS.hpp similarity index 100% rename from PAM/ssh/src/method/SMS.hpp rename to PAM/ssh/include/rublon/method/SMS.hpp diff --git a/PAM/ssh/src/method/method_factory.hpp b/PAM/ssh/include/rublon/method/method_factory.hpp similarity index 95% rename from PAM/ssh/src/method/method_factory.hpp rename to PAM/ssh/include/rublon/method/method_factory.hpp index 8809434..2e90e1c 100644 --- a/PAM/ssh/src/method/method_factory.hpp +++ b/PAM/ssh/include/rublon/method/method_factory.hpp @@ -4,9 +4,9 @@ #include -#include -#include -#include +#include +#include +#include #include "OTP.hpp" #include "SMS.hpp" diff --git a/PAM/ssh/src/pam.hpp b/PAM/ssh/include/rublon/pam.hpp similarity index 100% rename from PAM/ssh/src/pam.hpp rename to PAM/ssh/include/rublon/pam.hpp diff --git a/PAM/ssh/src/pam_action.hpp b/PAM/ssh/include/rublon/pam_action.hpp similarity index 100% rename from PAM/ssh/src/pam_action.hpp rename to PAM/ssh/include/rublon/pam_action.hpp diff --git a/PAM/ssh/src/rublon.hpp b/PAM/ssh/include/rublon/rublon.hpp similarity index 100% rename from PAM/ssh/src/rublon.hpp rename to PAM/ssh/include/rublon/rublon.hpp diff --git a/PAM/ssh/src/sign.hpp b/PAM/ssh/include/rublon/sign.hpp similarity index 100% rename from PAM/ssh/src/sign.hpp rename to PAM/ssh/include/rublon/sign.hpp diff --git a/PAM/ssh/src/span.hpp b/PAM/ssh/include/rublon/span.hpp similarity index 100% rename from PAM/ssh/src/span.hpp rename to PAM/ssh/include/rublon/span.hpp diff --git a/PAM/ssh/src/utils.hpp b/PAM/ssh/include/rublon/utils.hpp similarity index 100% rename from PAM/ssh/src/utils.hpp rename to PAM/ssh/include/rublon/utils.hpp diff --git a/PAM/ssh/lib/CMakeLists.txt b/PAM/ssh/lib/CMakeLists.txt new file mode 100644 index 0000000..98ae930 --- /dev/null +++ b/PAM/ssh/lib/CMakeLists.txt @@ -0,0 +1,14 @@ +add_library(rublon-ssh-pam + SHARED + pam.cpp +) + +target_link_options(rublon-ssh-pam + PUBLIC + -fpic -shared +) + +target_link_libraries(rublon-ssh-pam + PUBLIC + -lcurl -lssl -lcrypto rublon-ssh +) diff --git a/PAM/ssh/src/pam.cpp b/PAM/ssh/lib/pam.cpp similarity index 96% rename from PAM/ssh/src/pam.cpp rename to PAM/ssh/lib/pam.cpp index 53c168d..d3569ca 100644 --- a/PAM/ssh/src/pam.cpp +++ b/PAM/ssh/lib/pam.cpp @@ -6,8 +6,8 @@ #include -#include "rublon.hpp" -#include "utils.hpp" +#include +#include using namespace std; diff --git a/PAM/ssh/src/CMakeLists.txt b/PAM/ssh/src/CMakeLists.txt deleted file mode 100644 index 5c85ef3..0000000 --- a/PAM/ssh/src/CMakeLists.txt +++ /dev/null @@ -1,33 +0,0 @@ -add_library(rublon-ssh - INTERFACE - pam.hpp - rublon.hpp - curl.hpp - span.hpp - sign.hpp - CoreHandler.hpp - configuration.hpp -) - -#set(CMAKE_SHARED_LINKER_FLAGS "-fpic -static-libstdc++ -fvisibility=hidden -ffunction-sections -fdata-sections -fwhole-program") - -target_include_directories(rublon-ssh - PUBLIC INTERFACE - ../extern - ${CMAKE_CURRENT_LIST_DIR} -) - -add_library(rublon-ssh-pam - SHARED - pam.cpp -) - -target_link_options(rublon-ssh-pam - PUBLIC - -fpic -shared -) - -target_link_libraries(rublon-ssh-pam - PUBLIC - -lcurl -lssl -lcrypto rublon-ssh -) diff --git a/PAM/ssh/tests/core_handler_tests.cpp b/PAM/ssh/tests/core_handler_tests.cpp index b8fe0fc..0e78503 100644 --- a/PAM/ssh/tests/core_handler_tests.cpp +++ b/PAM/ssh/tests/core_handler_tests.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include "http_mock.hpp" class CoreHandlerTestable : public rublon::CoreHandler< HttpHandlerMock > { diff --git a/PAM/ssh/tests/http_mock.hpp b/PAM/ssh/tests/http_mock.hpp index 9bb0bf8..f35941f 100644 --- a/PAM/ssh/tests/http_mock.hpp +++ b/PAM/ssh/tests/http_mock.hpp @@ -5,8 +5,8 @@ #include #include -#include "../src/curl.hpp" -#include "../src/configuration.hpp" +#include +#include #include "core_response_generator.hpp" diff --git a/PAM/ssh/tests/init_test.cpp b/PAM/ssh/tests/init_test.cpp index 651d95e..7387d61 100644 --- a/PAM/ssh/tests/init_test.cpp +++ b/PAM/ssh/tests/init_test.cpp @@ -1,7 +1,7 @@ #include #include -#include "../src/rublon.hpp" +#include #include "core_response_generator.hpp" diff --git a/PAM/ssh/tests/rublonTests.cpp b/PAM/ssh/tests/rublonTests.cpp index 46103fd..0ed9da6 100644 --- a/PAM/ssh/tests/rublonTests.cpp +++ b/PAM/ssh/tests/rublonTests.cpp @@ -1,7 +1,7 @@ #include #include -#include "../src/rublon.hpp" +#include using namespace testing; diff --git a/PAM/ssh/tests/utilsTests.cpp b/PAM/ssh/tests/utilsTests.cpp index aaa1e6d..0465a0c 100644 --- a/PAM/ssh/tests/utilsTests.cpp +++ b/PAM/ssh/tests/utilsTests.cpp @@ -4,7 +4,7 @@ #include #include -#include "../src/utils.hpp" +#include using namespace rublon; using namespace testing;