mirror of
https://github.com/telemt/telemt.git
synced 2026-11-25 16:48:50 +03:00
WEB: Resolve opt-in decoy hostnames during config preparation #929
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use super::*;
|
||||
|
||||
/// Typed source together with its exact include graph and rendered input.
|
||||
pub(super) type DecodedSourceGraph = (
|
||||
ProxyConfig,
|
||||
BTreeSet<PathBuf>,
|
||||
@@ -7,6 +8,7 @@ pub(super) type DecodedSourceGraph = (
|
||||
String,
|
||||
);
|
||||
|
||||
/// Decodes source while retaining the metadata needed for atomic mutations.
|
||||
pub(super) fn decode_source_graph(graph: ConfigSourceGraph) -> Result<DecodedSourceGraph> {
|
||||
let ConfigSourceGraph {
|
||||
source_contents,
|
||||
@@ -17,6 +19,7 @@ pub(super) fn decode_source_graph(graph: ConfigSourceGraph) -> Result<DecodedSou
|
||||
let parsed_toml: toml::Value =
|
||||
toml::from_str(&processed).map_err(|e| ProxyError::Config(e.to_string()))?;
|
||||
handle_unknown_config_keys(&parsed_toml)?;
|
||||
ProxyConfig::validate_decoy_source_keys(&parsed_toml)?;
|
||||
let general_table = parsed_toml
|
||||
.get("general")
|
||||
.and_then(|value| value.as_table());
|
||||
|
||||
Reference in New Issue
Block a user