IXWebSocket/ws/snake/IXAppConfig.h

41 lines
802 B
C
Raw Normal View History

/*
* IXAppConfig.h
* Author: Benjamin Sergeant
* Copyright (c) 2019 Machine Zone, Inc. All rights reserved.
*/
#pragma once
2019-05-30 17:46:50 +02:00
#include "nlohmann/json.hpp"
#include <string>
#include <vector>
namespace snake
{
struct AppConfig
{
// Server
std::string hostname;
int port;
// Redis
std::vector<std::string> redisHosts;
int redisPort;
std::string redisPassword;
// AppKeys
nlohmann::json apps;
// Misc
bool verbose;
};
2019-05-30 17:46:50 +02:00
bool isAppKeyValid(const AppConfig& appConfig, std::string appkey);
2019-05-30 17:46:50 +02:00
std::string getRoleSecret(const AppConfig& appConfig, std::string appkey, std::string role);
std::string generateNonce();
void dumpConfig(const AppConfig& appConfig);
2019-05-30 17:46:50 +02:00
} // namespace snake