Code sanitizer output

This commit is contained in:
stephb9959
2022-03-25 20:57:12 -07:00
parent 02566e8e0b
commit 809b4bb79d
4 changed files with 21 additions and 11 deletions

View File

@@ -24,7 +24,7 @@ namespace OpenWifi {
std::string FileType_;
std::string Name_;
std::string Id_;
[[maybe_unused]] Poco::Logger &Logger_;
Poco::Logger &Logger_;
std::stringstream &OutputStream_;
inline Poco::Logger & Logger() { return Logger_; };

View File

@@ -92,12 +92,26 @@ namespace OpenWifi {
auto Secret = GenerateSecret(20, Base32Secret);
QRCode = GenerateQRCode(Base32Secret, User.email);
/*
struct Entry {
bool Subscriber=false;
uint64_t Start = 0;
uint64_t Done = 0 ;
uint64_t Verifications = 0 ;
std::string Secret;
std::string QRCode;
std::string LastCode;
};
*/
Entry E{ .Subscriber = Subscriber,
.Start = (uint64_t )std::time(nullptr),
.Start = OpenWifi::Now(),
.Done = 0,
.Verifications = 0,
.Secret = Secret,
.QRCode = QRCode
.QRCode = QRCode,
.LastCode = 0
};
Cache_[User.id] = E;
return true;

View File

@@ -43,9 +43,8 @@ namespace OpenWifi {
}
BaseTokenDB::BaseTokenDB(const std::string &Name, const std::string &ShortName, OpenWifi::DBType T,
Poco::Data::SessionPool &P, Poco::Logger &L, TokenCache *Cache, bool Users) :
DB(T, Name.c_str(), BaseTokenDB_Fields, MakeIndices(ShortName), P, L, ShortName.c_str(), Cache),
UsersOnly_(Users) {
Poco::Data::SessionPool &P, Poco::Logger &L, TokenCache *Cache, [[maybe_unused]] bool Users) :
DB(T, Name.c_str(), BaseTokenDB_Fields, MakeIndices(ShortName), P, L, ShortName.c_str(), Cache) {
}
bool BaseTokenDB::AddToken(std::string &UserID, std::string &Token, std::string &RefreshToken, [[maybe_unused]] std::string & TokenType, uint64_t Expires, uint64_t TimeOut) {
@@ -98,9 +97,8 @@ namespace OpenWifi {
return true;
}
TokenCache::TokenCache(unsigned Size, unsigned TimeOut, bool Users) :
ORM::DBCache<SecurityObjects::Token>(Size,TimeOut),
UsersOnly_(Users)
TokenCache::TokenCache(unsigned Size, unsigned TimeOut, [[maybe_unused]] bool Users) :
ORM::DBCache<SecurityObjects::Token>(Size,TimeOut)
{
CacheByToken_ = std::make_unique<Poco::ExpireLRUCache<std::string,SecurityObjects::Token>>(Size,TimeOut);
}

View File

@@ -44,7 +44,6 @@ namespace OpenWifi {
private:
std::mutex Mutex_;
[[maybe_unused]] bool UsersOnly_;
std::unique_ptr<Poco::ExpireLRUCache<std::string,SecurityObjects::Token>> CacheByToken_;
};
@@ -62,7 +61,6 @@ namespace OpenWifi {
bool RevokeAllTokens( std::string & UserName );
bool GetToken(std::string &Token, SecurityObjects::WebToken &WT, std::string & UserId, uint64_t &RevocationDate);
private:
[[maybe_unused]] bool UsersOnly_;
};
}