Skip to content

Commit 09e3c0c

Browse files
committed
Removed api key.
1 parent 5c801ec commit 09e3c0c

File tree

6 files changed

+3
-10
lines changed

6 files changed

+3
-10
lines changed

sources/config.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ std::string Config::mqttUrl() const { return m_argConfig.mqttUrl; }
5555
std::string Config::mqttUsername() const { return m_argConfig.mqttUser; }
5656
std::string Config::mqttPassword() const { return m_argConfig.mqttPassword; }
5757

58-
std::string Config::apiKey() const { return m_fileConfig.api_key; }
5958
std::string Config::latitude() const { return m_fileConfig.position.latitude; }
6059
std::string Config::longitude() const { return m_fileConfig.position.longitude; }
6160
int Config::altitude() const { return m_fileConfig.position.altitude; }

sources/config.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class Config {
5959
std::string mqttUsername() const;
6060
std::string mqttPassword() const;
6161

62-
std::string apiKey() const;
6362
std::string latitude() const;
6463
std::string longitude() const;
6564
int altitude() const;

sources/file_config.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ nlohmann::json FileConfig::toSave(nlohmann::json json) {
2323

2424
nlohmann::json FileConfig::toPrint(nlohmann::json json) {
2525
try {
26-
if (!json["api_key"].empty()) {
27-
json["api_key"] = "******";
28-
}
2926
std::regex regex(R"(^(\d+)\.\d+)");
3027
json["position"]["latitude"] = std::regex_replace(json["position"]["latitude"].get<std::string>(), regex, "$1.********");
3128
json["position"]["longitude"] = std::regex_replace(json["position"]["longitude"].get<std::string>(), regex, "$1.********");

sources/file_config.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ struct RecordingConfig {
3535
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(RecordingConfig, min_sample_rate, min_time_ms, max_noise_time_ms, step)
3636

3737
struct FileConfig {
38-
std::string api_key;
3938
std::vector<Device> devices;
4039
std::vector<IgnoredFrequency> ignored_frequencies;
4140
OutputConfig output;
@@ -48,4 +47,4 @@ struct FileConfig {
4847
static nlohmann::json toSave(nlohmann::json json);
4948
static nlohmann::json toPrint(nlohmann::json json);
5049
};
51-
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(FileConfig, api_key, devices, ignored_frequencies, output, position, recording, version, workers)
50+
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(FileConfig, devices, ignored_frequencies, output, position, recording, version, workers)

sources/network/query.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ struct SchedulerQuery {
77
std::string latitude;
88
std::string longitude;
99
int altitude;
10-
std::string api_key;
1110
std::vector<Satellite> satellites;
1211
std::vector<Crontab> crontabs;
1312
};
14-
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(SchedulerQuery, latitude, longitude, altitude, api_key, satellites, crontabs)
13+
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(SchedulerQuery, latitude, longitude, altitude, satellites, crontabs)
1514

1615
struct ScheduledTransmission {
1716
std::string name;

sources/radio/scheduler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void Scheduler::worker() {
7878

7979
void Scheduler::query() {
8080
Logger::info(LABEL, "send query");
81-
const SchedulerQuery query(m_config.latitude(), m_config.longitude(), m_config.altitude(), m_config.apiKey(), m_device.satellites, m_device.crontabs);
81+
const SchedulerQuery query(m_config.latitude(), m_config.longitude(), m_config.altitude(), m_device.satellites, m_device.crontabs);
8282
m_remoteController.schedulerQuery(m_device.getName(), static_cast<nlohmann::json>(query).dump());
8383
}
8484

0 commit comments

Comments
 (0)