Commit 94901ec3 authored by Nick Mathewson's avatar Nick Mathewson 👁
Browse files

Apply "deny_unknown_fields" to configuration types.

parent 209d1df2
......@@ -46,6 +46,7 @@ const ARTI_DEFAULTS: &str = concat!(
/// NOTE: These are NOT the final options or their final layout.
/// Expect NO stability here.
#[derive(Deserialize, Debug, Clone)]
#[serde(deny_unknown_fields)]
struct ArtiConfig {
/// Port to listen on (at localhost) for incoming SOCKS
/// connections.
......@@ -64,6 +65,7 @@ struct ArtiConfig {
///
/// This section is for read/write storage
#[derive(Deserialize, Debug, Clone)]
#[serde(deny_unknown_fields)]
struct StorageConfig {
/// Location on disk for cached directory information
cache_dir: CfgPath,
......
......@@ -8,6 +8,10 @@ use tor_llcrypto::pk::rsa::RSAIdentity;
use tor_netdoc::doc::authcert::{AuthCert, AuthCertKeyIds};
/// A single authority that signs a consensus directory.
//
// Note that we do *not* set serde(deny_unknown_fields)] on this structure:
// we want our authorities format to be future-proof against adding new info
// about each authority.
#[derive(Deserialize, Debug, Clone)]
pub struct Authority {
/// A memorable nickname for this authority.
......
......@@ -18,6 +18,7 @@ use serde::Deserialize;
/// Arti's configuration.
// TODO: move this?
#[derive(Deserialize, Debug, Clone)]
#[serde(deny_unknown_fields)]
pub struct NetworkConfig {
/// List of locations to look in when downloading directory information,
/// if we don't actually have a directory yet.
......
......@@ -17,6 +17,10 @@ use std::net::SocketAddr;
/// A directory whose location ships with Tor (or arti), and which we
/// can use for bootstrapping when we don't know anything else about
/// the network.
//
// Note that we do *not* set serde(deny_unknown_fields)] on this structure:
// we want our authorities format to be future-proof against adding new info
// about each authority.
#[derive(Debug, Clone, Deserialize)]
pub struct FallbackDir {
/// RSA identity for the directory relay
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment