mirror of
				https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
				synced 2025-10-30 18:27:49 +00:00 
			
		
		
		
	Compare commits
	
		
			9 Commits
		
	
	
		
			v2.6.0-RC3
			...
			v2.4.0-RC4
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 768c428a67 | ||
|   | 389ceb8b7d | ||
|   | 157f18c117 | ||
|   | 2538f9c768 | ||
|   | 85d998ad76 | ||
|   | a407f2e38d | ||
|   | d0d2be0870 | ||
|   | 78cba562e6 | ||
|   | 350df38c3f | 
| @@ -30,9 +30,20 @@ else() | |||||||
|     file(WRITE build ${BUILD_NUM}) |     file(WRITE build ${BUILD_NUM}) | ||||||
| endif() | endif() | ||||||
|  |  | ||||||
| set(BUILD_SHARED_LIBS 1) | find_package(Git QUIET) | ||||||
|  | if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git") | ||||||
|  |     execute_process(COMMAND ${GIT_EXECUTABLE} describe --always --tags | ||||||
|  |             WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||||||
|  |             RESULT_VARIABLE GIT_RESULT | ||||||
|  |             OUTPUT_VARIABLE GIT_HASH) | ||||||
|  |     if(NOT GIT_RESULT EQUAL "0") | ||||||
|  |         message(FATAL_ERROR "git describe --always --tags failed with ${GIT_RESULT}") | ||||||
|  |     endif() | ||||||
|  |     string(REGEX REPLACE "\n$" "" GIT_HASH "${GIT_HASH}") | ||||||
|  | endif() | ||||||
|  | add_definitions(-DAWS_CUSTOM_MEMORY_MANAGEMENT) | ||||||
|  |  | ||||||
| add_definitions(-DAPP_VERSION="${CMAKE_PROJECT_VERSION}" -DBUILD_NUMBER="${BUILD_NUM}") | set(BUILD_SHARED_LIBS 1) | ||||||
| add_definitions(-DTIP_SECURITY_SERVICE="1") | add_definitions(-DTIP_SECURITY_SERVICE="1") | ||||||
|  |  | ||||||
| set(Boost_USE_STATIC_LIBS OFF) | set(Boost_USE_STATIC_LIBS OFF) | ||||||
| @@ -50,8 +61,11 @@ find_package(Poco REQUIRED COMPONENTS JSON Crypto JWT Net Util NetSSL Data DataS | |||||||
|  |  | ||||||
| include_directories(/usr/local/include  /usr/local/opt/openssl/include src include/kafka /usr/local/opt/mysql-client/include) | include_directories(/usr/local/include  /usr/local/opt/openssl/include src include/kafka /usr/local/opt/mysql-client/include) | ||||||
|  |  | ||||||
|  | configure_file(src/ow_version.h.in ${PROJECT_SOURCE_DIR}/src/ow_version.h @ONLY) | ||||||
|  |  | ||||||
| add_executable( owsec | add_executable( owsec | ||||||
|         build |         build | ||||||
|  |         src/ow_version.h.in | ||||||
|         src/framework/CountryCodes.h |         src/framework/CountryCodes.h | ||||||
|         src/framework/KafkaTopics.h |         src/framework/KafkaTopics.h | ||||||
|         src/framework/MicroService.h |         src/framework/MicroService.h | ||||||
|   | |||||||
| @@ -56,6 +56,7 @@ RUN make install | |||||||
| ADD CMakeLists.txt build /owsec/ | ADD CMakeLists.txt build /owsec/ | ||||||
| ADD cmake /owsec/cmake | ADD cmake /owsec/cmake | ||||||
| ADD src /owsec/src | ADD src /owsec/src | ||||||
|  | ADD .git /owgw/.git | ||||||
|  |  | ||||||
| WORKDIR /owsec | WORKDIR /owsec | ||||||
| RUN mkdir cmake-build | RUN mkdir cmake-build | ||||||
|   | |||||||
| @@ -8,7 +8,7 @@ fullnameOverride: "" | |||||||
| images: | images: | ||||||
|   owsec: |   owsec: | ||||||
|     repository: tip-tip-wlan-cloud-ucentral.jfrog.io/owsec |     repository: tip-tip-wlan-cloud-ucentral.jfrog.io/owsec | ||||||
|     tag: main |     tag: v2.4.0-RC4 | ||||||
|     pullPolicy: Always |     pullPolicy: Always | ||||||
| #    regcred: | #    regcred: | ||||||
| #      registry: tip-tip-wlan-cloud-ucentral.jfrog.io | #      registry: tip-tip-wlan-cloud-ucentral.jfrog.io | ||||||
|   | |||||||
| @@ -69,6 +69,8 @@ using namespace std::chrono_literals; | |||||||
| #include "RESTObjects/RESTAPI_SecurityObjects.h" | #include "RESTObjects/RESTAPI_SecurityObjects.h" | ||||||
| #include "nlohmann/json.hpp" | #include "nlohmann/json.hpp" | ||||||
|  |  | ||||||
|  | #include "ow_version.h" | ||||||
|  |  | ||||||
| namespace OpenWifi { | namespace OpenWifi { | ||||||
|  |  | ||||||
|     enum UNAUTHORIZED_REASON { |     enum UNAUTHORIZED_REASON { | ||||||
| @@ -1900,7 +1902,7 @@ namespace OpenWifi { | |||||||
| 	            QB_.SerialNumber = GetParameter(RESTAPI::Protocol::SERIALNUMBER, ""); | 	            QB_.SerialNumber = GetParameter(RESTAPI::Protocol::SERIALNUMBER, ""); | ||||||
| 	            QB_.StartDate = GetParameter(RESTAPI::Protocol::STARTDATE, 0); | 	            QB_.StartDate = GetParameter(RESTAPI::Protocol::STARTDATE, 0); | ||||||
| 	            QB_.EndDate = GetParameter(RESTAPI::Protocol::ENDDATE, 0); | 	            QB_.EndDate = GetParameter(RESTAPI::Protocol::ENDDATE, 0); | ||||||
| 	            QB_.Offset = GetParameter(RESTAPI::Protocol::OFFSET, 1); | 	            QB_.Offset = GetParameter(RESTAPI::Protocol::OFFSET, 0); | ||||||
| 	            QB_.Limit = GetParameter(RESTAPI::Protocol::LIMIT, 100); | 	            QB_.Limit = GetParameter(RESTAPI::Protocol::LIMIT, 100); | ||||||
| 	            QB_.Filter = GetParameter(RESTAPI::Protocol::FILTER, ""); | 	            QB_.Filter = GetParameter(RESTAPI::Protocol::FILTER, ""); | ||||||
| 	            QB_.Select = GetParameter(RESTAPI::Protocol::SELECT, ""); | 	            QB_.Select = GetParameter(RESTAPI::Protocol::SELECT, ""); | ||||||
| @@ -1912,7 +1914,7 @@ namespace OpenWifi { | |||||||
| 	            QB_.AdditionalInfo = GetBoolParameter(RESTAPI::Protocol::WITHEXTENDEDINFO,false); | 	            QB_.AdditionalInfo = GetBoolParameter(RESTAPI::Protocol::WITHEXTENDEDINFO,false); | ||||||
|  |  | ||||||
| 	            if(QB_.Offset<1) | 	            if(QB_.Offset<1) | ||||||
| 	                QB_.Offset=1; | 	                QB_.Offset=0; | ||||||
| 	            return true; | 	            return true; | ||||||
| 	        } | 	        } | ||||||
|  |  | ||||||
| @@ -2673,7 +2675,7 @@ namespace OpenWifi { | |||||||
| 		std::string 				MyPrivateEndPoint_; | 		std::string 				MyPrivateEndPoint_; | ||||||
| 		std::string 				MyPublicEndPoint_; | 		std::string 				MyPublicEndPoint_; | ||||||
| 		std::string                 UIURI_; | 		std::string                 UIURI_; | ||||||
| 		std::string 				Version_{std::string(APP_VERSION) + "("+ BUILD_NUMBER + ")"}; | 		std::string 				Version_{ OW_VERSION::VERSION + "("+ OW_VERSION::BUILD + ")" + " - " + OW_VERSION::HASH }; | ||||||
| 		BusEventManager				BusEventManager_; | 		BusEventManager				BusEventManager_; | ||||||
| 		std::mutex 					InfraMutex_; | 		std::mutex 					InfraMutex_; | ||||||
| 		std::default_random_engine  RandomEngine_; | 		std::default_random_engine  RandomEngine_; | ||||||
|   | |||||||
| @@ -2,8 +2,7 @@ | |||||||
| // Created by stephane bourque on 2021-10-06. | // Created by stephane bourque on 2021-10-06. | ||||||
| // | // | ||||||
|  |  | ||||||
| #ifndef OPENWIFI_STORAGE_H | #pragma once | ||||||
| #define OPENWIFI_STORAGE_H |  | ||||||
|  |  | ||||||
| #include "Poco/Data/Session.h" | #include "Poco/Data/Session.h" | ||||||
| #include "Poco/Data/SessionPool.h" | #include "Poco/Data/SessionPool.h" | ||||||
| @@ -54,13 +53,13 @@ namespace OpenWifi { | |||||||
|  |  | ||||||
|         [[nodiscard]] inline std::string ComputeRange(uint64_t From, uint64_t HowMany) { |         [[nodiscard]] inline std::string ComputeRange(uint64_t From, uint64_t HowMany) { | ||||||
|             if(dbType_==sqlite) { |             if(dbType_==sqlite) { | ||||||
|                 return " LIMIT " + std::to_string(From-1) + ", " + std::to_string(HowMany) + " "; |                 return " LIMIT " + std::to_string(From) + ", " + std::to_string(HowMany) + " "; | ||||||
|             } else if(dbType_==pgsql) { |             } else if(dbType_==pgsql) { | ||||||
|                 return " LIMIT " + std::to_string(HowMany) + " OFFSET " + std::to_string(From-1) + " "; |                 return " LIMIT " + std::to_string(HowMany) + " OFFSET " + std::to_string(From) + " "; | ||||||
|             } else if(dbType_==mysql) { |             } else if(dbType_==mysql) { | ||||||
|                 return " LIMIT " + std::to_string(HowMany) + " OFFSET " + std::to_string(From-1) + " "; |                 return " LIMIT " + std::to_string(HowMany) + " OFFSET " + std::to_string(From) + " "; | ||||||
|             } |             } | ||||||
|             return " LIMIT " + std::to_string(HowMany) + " OFFSET " + std::to_string(From-1) + " "; |             return " LIMIT " + std::to_string(HowMany) + " OFFSET " + std::to_string(From) + " "; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         inline std::string ConvertParams(const std::string & S) const { |         inline std::string ConvertParams(const std::string & S) const { | ||||||
| @@ -165,5 +164,3 @@ namespace OpenWifi { | |||||||
| #endif | #endif | ||||||
|  |  | ||||||
| } | } | ||||||
|  |  | ||||||
| #endif //OPENWIFI_STORAGE_H |  | ||||||
|   | |||||||
							
								
								
									
										13
									
								
								src/ow_version.h.in
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								src/ow_version.h.in
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | |||||||
|  | // | ||||||
|  | // Created by stephane bourque on 2021-12-06. | ||||||
|  | // | ||||||
|  |  | ||||||
|  | #pragma once | ||||||
|  |  | ||||||
|  | #include <string> | ||||||
|  |  | ||||||
|  | namespace OW_VERSION { | ||||||
|  |     inline static const std::string VERSION{"@CMAKE_PROJECT_VERSION@"}; | ||||||
|  |     inline static const std::string BUILD{"@BUILD_NUM@"}; | ||||||
|  |     inline static const std::string HASH{"@GIT_HASH@"}; | ||||||
|  | } | ||||||
| @@ -15,23 +15,23 @@ namespace OpenWifi { | |||||||
|             "description    varchar," |             "description    varchar," | ||||||
|             "avatar         varchar," |             "avatar         varchar," | ||||||
|             "email          varchar," |             "email          varchar," | ||||||
|             "validated      int," |             "validated      boolean," | ||||||
|             "validationEmail    varchar," |             "validationEmail    varchar," | ||||||
|             "validationDate bigint," |             "validationDate bigint," | ||||||
|             "creationDate   bigint," |             "creationDate   bigint," | ||||||
|             "validationURI  varchar," |             "validationURI  varchar," | ||||||
|             "changePassword int," |             "changePassword boolean," | ||||||
|             "lastLogin      bigint," |             "lastLogin      bigint," | ||||||
|             "currentLoginURI    varchar," |             "currentLoginURI    varchar," | ||||||
|             "lastPasswordChange bigint," |             "lastPasswordChange bigint," | ||||||
|             "lastEmailCheck     bigint," |             "lastEmailCheck     bigint," | ||||||
|             "waitingForEmailCheck   int," |             "waitingForEmailCheck   boolean," | ||||||
|             "locale             varchar," |             "locale             varchar," | ||||||
|             "notes              text," |             "notes              text," | ||||||
|             "location           varchar," |             "location           varchar," | ||||||
|             "owner              varchar," |             "owner              varchar," | ||||||
|             "suspended          int," |             "suspended          boolean," | ||||||
|             "blackListed        int," |             "blackListed        boolean," | ||||||
|             "userRole           varchar," |             "userRole           varchar," | ||||||
|             "userTypeProprietaryInfo    text," |             "userTypeProprietaryInfo    text," | ||||||
|             "securityPolicy     text," |             "securityPolicy     text," | ||||||
| @@ -111,23 +111,23 @@ namespace OpenWifi { | |||||||
|         std::string,    // description; |         std::string,    // description; | ||||||
|         std::string,    // avatar; |         std::string,    // avatar; | ||||||
|         std::string,    // email; |         std::string,    // email; | ||||||
|         uint64_t,       // bool validated = false; |         bool,       // bool validated = false; | ||||||
|         std::string,    // validationEmail; |         std::string,    // validationEmail; | ||||||
|         uint64_t,       // validationDate = 0; |         uint64_t,       // validationDate = 0; | ||||||
|         uint64_t,       // creationDate = 0; |         uint64_t,       // creationDate = 0; | ||||||
|         std::string,    // validationURI; |         std::string,    // validationURI; | ||||||
|         uint64_t,       // bool changePassword = true; |         bool,       // bool changePassword = true; | ||||||
|         uint64_t,       // lastLogin = 0; |         uint64_t,       // lastLogin = 0; | ||||||
|         std::string,    // currentLoginURI; |         std::string,    // currentLoginURI; | ||||||
|         uint64_t,       // lastPasswordChange = 0; |         uint64_t,       // lastPasswordChange = 0; | ||||||
|         uint64_t,       // lastEmailCheck = 0; |         uint64_t,       // lastEmailCheck = 0; | ||||||
|         uint64_t,      // bool waitingForEmailCheck = false; |         bool,      // bool waitingForEmailCheck = false; | ||||||
|         std::string,    // locale; |         std::string,    // locale; | ||||||
|         std::string,    // notes; |         std::string,    // notes; | ||||||
|         std::string,    // location; |         std::string,    // location; | ||||||
|         std::string,    // owner; |         std::string,    // owner; | ||||||
|         uint64_t,       // bool suspended = false; |         bool,       // bool suspended = false; | ||||||
|         uint64_t,       // bool blackListed = false; |         bool,       // bool blackListed = false; | ||||||
|         std::string,    // userRole; |         std::string,    // userRole; | ||||||
|         std::string,    // userTypeProprietaryInfo; |         std::string,    // userTypeProprietaryInfo; | ||||||
|         std::string,    // securityPolicy; |         std::string,    // securityPolicy; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user