mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
synced 2025-11-02 03:37:51 +00:00
New UUIDv4 generator
This commit is contained in:
@@ -346,7 +346,7 @@ namespace OpenWifi {
|
||||
|
||||
A.action = OpenWifi::SecurityObjects::LinkActions::VERIFY_EMAIL;
|
||||
A.userId = UInfo.email;
|
||||
A.id = MicroService::instance().CreateUUID();
|
||||
A.id = MicroService::CreateUUID();
|
||||
A.created = std::time(nullptr);
|
||||
A.expires = A.created + 24*60*60;
|
||||
StorageService()->CreateAction(A);
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace OpenWifi {
|
||||
return false;
|
||||
|
||||
std::string Challenge = MakeChallenge();
|
||||
std::string uuid = MicroService::instance().CreateUUID();
|
||||
std::string uuid = MicroService::CreateUUID();
|
||||
uint64_t Created = std::time(nullptr);
|
||||
|
||||
ChallengeStart.set("uuid",uuid);
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace OpenWifi {
|
||||
SecurityObjects::ActionLink NewLink;
|
||||
|
||||
NewLink.action = OpenWifi::SecurityObjects::LinkActions::FORGOT_PASSWORD;
|
||||
NewLink.id = MicroService::instance().CreateUUID();
|
||||
NewLink.id = MicroService::CreateUUID();
|
||||
NewLink.userId = UInfo1.Id;
|
||||
NewLink.created = std::time(nullptr);
|
||||
NewLink.expires = NewLink.created + (24*60*60);
|
||||
|
||||
@@ -2630,7 +2630,7 @@ namespace OpenWifi {
|
||||
inline void InitializeSubSystemServers();
|
||||
inline void StartSubSystemServers();
|
||||
inline void StopSubSystemServers();
|
||||
[[nodiscard]] inline std::string CreateUUID();
|
||||
[[nodiscard]] static inline std::string CreateUUID();
|
||||
inline bool SetSubsystemLogLevel(const std::string &SubSystem, const std::string &Level);
|
||||
inline void Reload(const std::string &Sub);
|
||||
inline Types::StringVec GetSubSystems() const;
|
||||
@@ -2969,7 +2969,7 @@ namespace OpenWifi {
|
||||
|
||||
[[nodiscard]] inline std::string MicroService::CreateUUID() {
|
||||
static std::random_device rd;
|
||||
static std::mt19937 gen(rd());
|
||||
static std::mt19937_64 gen(rd());
|
||||
static std::uniform_int_distribution<> dis(0, 15);
|
||||
static std::uniform_int_distribution<> dis2(8, 11);
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ namespace OpenWifi {
|
||||
return false;
|
||||
|
||||
if(!PasswordHashedAlready) {
|
||||
NewUser.Id = MicroService::instance().CreateUUID();
|
||||
NewUser.Id = MicroService::CreateUUID();
|
||||
NewUser.creationDate = std::time(nullptr);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user