Add authenticator debug to entry gateway config
This commit is contained in:
@@ -409,6 +409,9 @@ async fn migrate_gateway(mut args: Args) -> Result<(), NymNodeError> {
|
||||
bind_address: SocketAddr::new(ip, cfg.gateway.clients_port),
|
||||
announce_ws_port: None,
|
||||
announce_wss_port: cfg.gateway.clients_wss_port,
|
||||
authenticator: config::authenticator::Authenticator {
|
||||
debug: Default::default(),
|
||||
},
|
||||
debug: config::entry_gateway::Debug {
|
||||
message_retrieval_limit: cfg.debug.message_retrieval_limit,
|
||||
},
|
||||
@@ -454,7 +457,7 @@ async fn migrate_gateway(mut args: Args) -> Result<(), NymNodeError> {
|
||||
.unwrap_or_default(),
|
||||
},
|
||||
},
|
||||
authenticator: config::exit_gateway::Authenticator {
|
||||
authenticator: config::authenticator::Authenticator {
|
||||
debug: Default::default(),
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// Copyright 2024 - Nym Technologies SA <contact@nymtech.net>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
use nym_client_core_config_types::DebugConfig as ClientDebugConfig;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, PartialEq, Serialize)]
|
||||
pub struct Authenticator {
|
||||
#[serde(default)]
|
||||
pub debug: AuthenticatorDebug,
|
||||
}
|
||||
|
||||
#[allow(clippy::derivable_impls)]
|
||||
impl Default for Authenticator {
|
||||
fn default() -> Self {
|
||||
Authenticator {
|
||||
debug: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, Deserialize, PartialEq, Serialize)]
|
||||
#[serde(default)]
|
||||
pub struct AuthenticatorDebug {
|
||||
/// Specifies whether authenticator service is enabled in this process.
|
||||
/// This is only here for debugging purposes as exit gateway should always run
|
||||
/// the authenticator.
|
||||
pub enabled: bool,
|
||||
|
||||
/// Disable Poisson sending rate.
|
||||
/// This is equivalent to setting client_debug.traffic.disable_main_poisson_packet_distribution = true
|
||||
/// (or is it (?))
|
||||
pub disable_poisson_rate: bool,
|
||||
|
||||
/// Shared detailed client configuration options
|
||||
#[serde(flatten)]
|
||||
pub client_debug: ClientDebugConfig,
|
||||
}
|
||||
|
||||
impl Default for AuthenticatorDebug {
|
||||
fn default() -> Self {
|
||||
AuthenticatorDebug {
|
||||
enabled: true,
|
||||
disable_poisson_rate: true,
|
||||
client_debug: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,8 @@ use serde::{Deserialize, Serialize};
|
||||
use std::net::SocketAddr;
|
||||
use std::path::Path;
|
||||
|
||||
use super::authenticator::Authenticator;
|
||||
|
||||
pub const DEFAULT_WS_PORT: u16 = DEFAULT_CLIENT_LISTENING_PORT;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
@@ -38,6 +40,8 @@ pub struct EntryGatewayConfig {
|
||||
#[serde(deserialize_with = "de_maybe_port")]
|
||||
pub announce_wss_port: Option<u16>,
|
||||
|
||||
pub authenticator: Authenticator,
|
||||
|
||||
#[serde(default)]
|
||||
pub debug: Debug,
|
||||
}
|
||||
@@ -69,6 +73,7 @@ impl EntryGatewayConfig {
|
||||
bind_address: SocketAddr::new(inaddr_any(), DEFAULT_WS_PORT),
|
||||
announce_ws_port: None,
|
||||
announce_wss_port: None,
|
||||
authenticator: Default::default(),
|
||||
debug: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ use serde::{Deserialize, Serialize};
|
||||
use std::path::Path;
|
||||
use url::Url;
|
||||
|
||||
use super::LocalWireguardOpts;
|
||||
use super::{authenticator::Authenticator, LocalWireguardOpts};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
@@ -139,49 +139,6 @@ impl Default for IpPacketRouterDebug {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, PartialEq, Serialize)]
|
||||
pub struct Authenticator {
|
||||
#[serde(default)]
|
||||
pub debug: AuthenticatorDebug,
|
||||
}
|
||||
|
||||
#[allow(clippy::derivable_impls)]
|
||||
impl Default for Authenticator {
|
||||
fn default() -> Self {
|
||||
Authenticator {
|
||||
debug: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, Deserialize, PartialEq, Serialize)]
|
||||
#[serde(default)]
|
||||
pub struct AuthenticatorDebug {
|
||||
/// Specifies whether authenticator service is enabled in this process.
|
||||
/// This is only here for debugging purposes as exit gateway should always run
|
||||
/// the authenticator.
|
||||
pub enabled: bool,
|
||||
|
||||
/// Disable Poisson sending rate.
|
||||
/// This is equivalent to setting client_debug.traffic.disable_main_poisson_packet_distribution = true
|
||||
/// (or is it (?))
|
||||
pub disable_poisson_rate: bool,
|
||||
|
||||
/// Shared detailed client configuration options
|
||||
#[serde(flatten)]
|
||||
pub client_debug: ClientDebugConfig,
|
||||
}
|
||||
|
||||
impl Default for AuthenticatorDebug {
|
||||
fn default() -> Self {
|
||||
AuthenticatorDebug {
|
||||
enabled: true,
|
||||
disable_poisson_rate: true,
|
||||
client_debug: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct EphemeralConfig {
|
||||
pub gateway: nym_gateway::config::Config,
|
||||
pub nr_opts: LocalNetworkRequesterOpts,
|
||||
|
||||
@@ -25,6 +25,7 @@ use std::time::Duration;
|
||||
use tracing::{debug, error};
|
||||
use url::Url;
|
||||
|
||||
pub mod authenticator;
|
||||
pub mod entry_gateway;
|
||||
pub mod exit_gateway;
|
||||
pub mod helpers;
|
||||
|
||||
Reference in New Issue
Block a user